git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Expected behavior of "git check-ignore"...

From
John Szakmeister <john@szakmeister.net>
Date
Jul 27, 2017, 11:20 UTC
Message-ID
<CAEBDL5U=pcqwzeQstiBBJpXngXeB4xTfKb7mos68kRAeumc5Rg@mail.gmail.com>
In-Reply-To
<xmqq4lu1ej0d.fsf@gitster.mtv.corp.google.com>

On Mon, Jul 24, 2017 at 3:23 PM, Junio C Hamano <gitster@pobox.com> wrote: [snip]

Show 12 quoted lines
> I am reasonably sure that the command started its life as a pure
> debugging aid.
>
> The treatment of the negation _might_ impose conflicting goals to
> its purpose as a debugging aid---a user who debugs his .gitignore
> file would want to know what causes a thing that wants to be ignored
> is not or vice versa, and use of the exit status to indicate if it
> is ignored may not mesh well with its goal as a debugging aid, but I
> didn't think about the potential issues deeply myself while writing
> this response.  As you mentioned, use of (or not using) "-v" could
> be used as a sign to see which behaviour the end-user expects, I
> guess.

Is there another way of checking to see if a file is ignored? If so, maybe we could suggest that instead. Perhaps using `git status --porcelain --ignored` and examining the output? I'm not sure how well that would work with directories.

Thanks for the insight Junio. I'm going to let the exit status thing drop for now. You don't seem like it's a good thing to do, and I'm not particularly fond of having it behave two different ways based on `-v` being present.

-John
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “Expected behavior of "git check-ignore"...”
  1. John SzakmeisterJul 20, 2017
  2. Philip OakleyJul 23, 2017
  3. John SzakmeisterJul 24, 2017
  4. Junio C HamanoJul 24, 2017
  5. John SzakmeisterJul 27, 2017
  6. Junio C HamanoJul 27, 2017
  7. Philip OakleyJul 30, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.