git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile
@ 2014-10-12  2:58 Dun Peal
  2014-10-12 14:48 ` Dun Peal
  2014-10-12 23:53 ` Duy Nguyen
  0 siblings, 2 replies; 4+ messages in thread
From: Dun Peal @ 2014-10-12  2:58 UTC (permalink / raw)
  To: Git ML

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?

Thanks, D.

[1] http://jk.gs/gitignore.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile
  2014-10-12  2:58 $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile Dun Peal
@ 2014-10-12 14:48 ` Dun Peal
  2014-10-12 23:53 ` Duy Nguyen
  1 sibling, 0 replies; 4+ messages in thread
From: Dun Peal @ 2014-10-12 14:48 UTC (permalink / raw)
  To: Git ML

I used `check-ignore -v`, and the `.out` file is being ignored by the
`*.out` pattern in the `core.excludesfile` file. Its parent folder is
not being ignored. So as a rule, `core.excludesfile` overrides
`$GIT_DIR/info/exclude`.

That doesn't make much sense to me, because I'm much more likely to
want to override global exclusions for a specific project, than
override specific project settings with a global exclusion file (that
last one really makes no sense imho).

Thoughts?

On Sat, Oct 11, 2014 at 10:58 PM, 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?
>
> Thanks, D.
>
> [1] http://jk.gs/gitignore.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile
  2014-10-12  2:58 $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile Dun Peal
  2014-10-12 14:48 ` Dun Peal
@ 2014-10-12 23:53 ` Duy Nguyen
  2014-10-13 13:23   ` Dun Peal
  1 sibling, 1 reply; 4+ messages in thread
From: Duy Nguyen @ 2014-10-12 23:53 UTC (permalink / raw)
  To: Dun Peal; +Cc: Git ML

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile
  2014-10-12 23:53 ` Duy Nguyen
@ 2014-10-13 13:23   ` Dun Peal
  0 siblings, 0 replies; 4+ messages in thread
From: Dun Peal @ 2014-10-13 13:23 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Git ML

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:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-13 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12  2:58 $GIT_DIR/info/exclude fails to negate a pattern defined by core.excludesfile Dun Peal
2014-10-12 14:48 ` Dun Peal
2014-10-12 23:53 ` Duy Nguyen
2014-10-13 13:23   ` Dun Peal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).