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

Re: $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile

From
Dun Peal <dunpealer@gmail.com>
Date
Oct 13, 2014, 13:23 UTC
Message-ID
<CAD03jn5s2NzcSDdwZ_SYe1Q1uq8gt+meeJycEcmzAj3SbZOJ4w@mail.gmail.com>
In-Reply-To
<CACsJy8Aj-_VhiiG9ogoABaGs69TQ+HyEnOVb75UT53W5+YcKVg@mail.gmail.com>
Hey Duy,

I'm not sure why the pattern would have to be as you describe - I'm just looking to ignore `*.out` as a general configuration, and disable it for one specific project, so it would seem a plain `!*.out` should work.

In any case, I added a `.gitignore` file with the single pattern `!*.out` at the root of the project, and now .out files are no longer ignored for the project.

It's not an ideal solution because now all the other developers of the project who do not have `*.out` in their `core.excludesfile` will have an unnecessary pattern in their exclusion logic, but it does work as expected.

Thanks, D.
On Sun, Oct 12, 2014 at 7:53 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 26 quoted lines
> On Sun, Oct 12, 2014 at 9:58 AM, Dun Peal <dunpealer@gmail.com> wrote:
>> I have the pattern `*.out` defined in my `core.excludesfile`.
>> According to the documentation[1], patterns defined in
>> `$GIT_DIR/info/exclude` take precedence over `core.excludesfile`, so
>> for one particular project that needs to track some `.out` files, I
>> created `$GIT_DIR/info/exclude` with just one pattern: `!*.out`.
>>
>> Yet for some reason, `git status` still fails to report newly created
>> `.out` files for that project. Am I misunderstanding the
>> documentation?
>
> We process in groups, so rules in core.excludesfile are in one group,
> those in $GIT_DIR/info/exclude in another group. Negative patterns
> only has effects within their group, so !*out in .../exclude can't
> revert *.out in core.excludesfile. Probably implementation limitation,
> not by design..
>
> But even if we flatten them into one group, i'm not sure you can
> achieve that. The patterns would be
>
> !*.out
> *.out
>
> "!*.out" has nothing to revert because it's before "*.out".
> --
> Duy
Previous: Duy Nguyen
Message 4 of 4 in “$GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile”
  1. Dun PealOct 12, 2014
  2. Dun PealOct 12, 2014
  3. Duy NguyenOct 12, 2014
  4. Dun PealOct 13, 2014

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.