Re: [PATCH] check-ignore: fix handling with negated patterns
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 17, 2020, 18:41 UTC
- Message-ID
- <CABPp-BEbojaeYkSMR7vntW0SkWf6dVOko5H=jqT-Yv2USRerxA@mail.gmail.com>
- In-Reply-To
- <xmqqimk5ks39.fsf@gitster-ct.c.googlers.com>
On Mon, Feb 17, 2020 at 10:05 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> > "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > From: Elijah Newren <newren@gmail.com> > > > > check-ignore was meant to check ignore rules the same way git status and > > other commands would, and to report whether a path is excluded. It > > failed to do this (and generated a few bug reports), however, because it > > did not account for negated patterns. > > I suspect that the above distorts history. IIRC, it was meant as a > tool to see which exact pattern in the exclude sequence had the > final say for the given needle, written primarily as a debugging > aid. In that context, "This rule has the final say", whether the > rule is a negative or positive, still means something.
I can reword it; how does the following sound?
check-ignore claims that it reports whether each path it is given is excluded. However, it fails to do so because it did not account for negated patterns.
Also, I think the "This rule has the final say" functionality of the tool might still be useful, so I kept it -- see my updates to the --verbose flag (mentioned later in the commit message).
Show 5 quoted lines
> It is just the behavior is _much_ less useful for those who want to > know what the final say is, and I tend to agree that we probably are > better off changing its output to reflect "so, are we ignoring the > path after all? yes/no?" because we are pretty much done with > debugging the exclude API implementation.