All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Yohei Endo <yoheie@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Wrong gitignore precedence?
Date: Wed, 22 Apr 2015 11:59:04 -0700	[thread overview]
Message-ID: <xmqqh9s8dm6f.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150422150558.6326cb6152a306f028fb6ad3@gmail.com> (Yohei Endo's message of "Wed, 22 Apr 2015 15:05:58 +0900")

Yohei Endo <yoheie@gmail.com> writes:

> I read the document of gitignore (http://git-scm.com/docs/gitignore),
> and learned that $GIT_DIR/info/exclude has higher precedence than
> the file specified by core.excludesfile.
>
> But I noticed that patterns in core.excludesfile override patterns in
> $GIT_DIR/info/exclude.

I tend to agree that info/exclude which is per-repository personal
preference should take precedence over $XDG_HOME/git/ignore which is
a personal preference across repositories that are accessed from
that machine.

It appears that the precedence was screwed-up between these two
files from the very beginning when 896bdfa2 (add: Support specifying
an excludes file with a configuration variable, 2007-02-27)
introduced core.excludesfile variable; seeing that nobody so far
complained with the discrepancy between the documentation and the
behaviour, it would indicate either (1) nobody reads the docs, or
(2) nobody uses both at the same time.

Swapping the order in the code this late in the game after 8 years
may affect people who have come to rely on the current behaviour and
never read the doc, which is somewhat worrying, though.

  reply	other threads:[~2015-04-22 18:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22  6:05 Wrong gitignore precedence? Yohei Endo
2015-04-22 18:59 ` Junio C Hamano [this message]
2015-04-23 12:11   ` Yohei Endo
2015-04-22 21:39 ` [PATCH] ignore: info/exclude should trump core.excludesfile Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh9s8dm6f.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=yoheie@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.