Subject: Re: bug#37189: 25.4.1: vc-hg-ignore implementation is missing

From: Wolfgang Scherer <[email-masked]>
Date: Sun, 23 Feb 2020 00:32:27 +0100

Am 22.02.20 um 15:30 schrieb Eli Zaretskii:
>> Cc: [email-masked], [email-masked]
>> From: Wolfgang Scherer <[email-masked]>
>> Date: Sat, 22 Feb 2020 14:46:16 +0100
> When I actually try this, I see something that confirms my
> understanding:
>
>   ~$ mkdir src_vcs
>   ~$ cd src_vcs
>   ~/src_vcs$ mkdir .src
>   ~/src_vcs$ touch file1
>   ~/src_vcs$ mkdir t1
>   ~/src_vcs$ touch t1/file1
>   ~/src_vcs$ src status t1/file1
>   ?       t1/file1
>   ~/src_vcs$ cat > .srcignore
>   t1/file1
>   ^D
>   ~/src_vcs$ src status t1/file1
>   I       t1/file1
>   ~/src_vcs$ src status -a
>   ?       .srcignore
>   ?       file1
>   ?       t1

This is to be expected from the way glob(3) works and the way SRC is programmed.
How do you jump to the conclusion, that this particular case is an indication that SRC
works like Git, when most other evidence points to the opposite?

What about the unwillingness of src status -a to recurse into
sub-directories, how does that correspond to Git, which can
often not be stopped to recurse?

  ~/src_vcs$ src status -a t1
  ?    t1
  ~/src_vcs$ src status -a t1/
  ?    t1/
  ~/src_vcs$ src status -a t1/.
  ?    t1/.
  ~/src_vcs$ src status -a t1/*
  I    t1/file1

Also, changing into t1 does not ignore file1 any more,
which is obviously inconsistent:

  ~/src_vcs$ cd t1
  ~/src_vcs/t1$ mkdir -p .src
  ~/src_vcs/t1$ src status -a
  ?    file1

Further, if there was a similar pattern propagation as for Git,
file1 should be ignored in both directories in this case:

  ~/src_vcs$ cat >.srcignore
  file1
  ^D
  ~/src_vcs$ src status -a
  ?    .srcignore
  I    file1
  ?    t1
  ~/src_vcs$ src status t1/file1
  ?    t1/file1

And it should not matter, where in the sub-tree the status command is issued:

  ~/src_vcs$ cd t1
  /src_vcs/t1$ src status file1
  ?    file1
  ~/src_vcs/t1$ src status ../file1
  ?    ../file1

>> There is also no notion of a root directory, i.e. SRC **never** checks
>> a parent directory for ignore patterns, which would be necessary for a
>> Git-style glob to work.
> The first part is true, but if we invoke "src status" from the root
> directory, the .srcignore file there will be read, and as the example
> above shows, will have its effect.  Right?

No, if it is not consistent in all parts of a sub-tree, the
behavior is an anomaly, not an indication of intent. So actually you
have found a bug, which you should report.