git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Dorab Patel <dorabpatel@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>, Alexandre Julliard <julliard@winehq.org>
Subject: Re: [PATCH] git.el: handle default excludesfile properly
Date: Sat, 3 Mar 2018 17:36:51 -0800
Message-ID: <CAE09B1+XXJvrOucHwehUGk=Taio7sirfOh5gq7KGs4iZSpK=vQ@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cR=adC_Ok=FJw2APaLahXX_v1ix4ufEJyBhED5ruXaQxA@mail.gmail.com>

[[Pardon the duplicate. I forgot to send via text/plain and the
mailing list bounced it, so resending.]]

Thanks for the feedback.

Correct me if I'm wrong, but my understanding, from
https://git-scm.com/docs/gitignore, is that $HOME/.gitignore is used
only if it is specified as the value of core.excludesfile in
~/.gitconfig. It is not used by default. If that is so, then the
proposed (and original) code works. The changes I am proposing handle
the default case, when core.excludesfile is not specified.

Looking deeper into how the function git-get-exclude-files is used, I
see that it is only being called from git-run-ls-files-with-excludes.
So, perhaps, a better (or additional) fix might be to add the
parameter "--exclude-standard" in the call to git-run-ls-files from
within git-run-ls-files-with-excludes. And remove the need for
get-get-exclude-files altogether.  Presumably, "--exclude-standard"
handles the default case with/without XDG_CONFIG_HOME correctly. The
question I'd have then is: why didn't the original author use that
option? Either I'm missing something? Or the option was added later,
after the original code was written? Or something else?

Thoughts?

On Sat, Mar 3, 2018 at 12:42 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Fri, Mar 2, 2018 at 10:48 PM, Dorab Patel <dorabpatel@gmail.com> wrote:
>> The previous version only looked at core.excludesfile for locating the
>> excludesfile.  So, when core.excludesfile was not defined, it did not
>> use the possible default locations.
>>
>> The current version uses either $XDG_CONFIG_HOME/git/ignore or
>> $HOME/.config/git/ignore for the default excludesfile location
>> depending on whether XDG_CONFIG_HOME is defined or not.  As per the
>> documentation of gitignore.
>
> Perhaps take $HOME/.gitignore into account too?
>
>> Signed-off-by: Dorab Patel <dorabpatel@gmail.com>

  reply index

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03  3:48 Dorab Patel
2018-03-03  8:42 ` Eric Sunshine
2018-03-04  1:36   ` Dorab Patel [this message]
2018-03-04  2:12     ` Eric Sunshine
2018-03-04  2:57       ` Dorab Patel
2018-03-04  4:34         ` Eric Sunshine
2018-03-05  2:36     ` Junio C Hamano
2018-03-06 11:54       ` Alexandre Julliard
2018-03-07 21:52         ` Dorab Patel
2018-03-08  9:41           ` Ævar Arnfjörð Bjarmason
2018-03-08  9:45         ` [PATCH] git{,-blame}.el: remove old bitrotting Emacs code Ævar Arnfjörð Bjarmason
2018-03-08 17:27           ` Junio C Hamano
2018-03-10 12:30             ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2018-03-10 16:50               ` Martin Ågren
2018-03-13 18:40                 ` Junio C Hamano
2018-03-08 17:55           ` [PATCH] " Kyle Meyer
2018-03-06  4:38 ` [PATCH v2] git.el: handle default excludesfile properly Dorab Patel
     [not found] <EKzyQbDEJGG4Lm5YboF8xg@mail.gmail.com>
2018-03-10 18:45 ` [PATCH v3] git{,-blame}.el: remove old bitrotting Emacs code Ævar Arnfjörð Bjarmason
2018-03-13 18:53   ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2018-03-13 22:14     ` Junio C Hamano
2018-03-27 16:57   ` [PATCH v3] " Jonathan Nieder
2018-04-11 20:42     ` [PATCH v4] " Ævar Arnfjörð Bjarmason
2018-04-12  2:19       ` Junio C Hamano
2018-04-12  6:52         ` Ævar Arnfjörð Bjarmason
2018-04-12  9:23           ` Junio C Hamano
2018-04-18 20:16             ` Todd Zullinger

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAE09B1+XXJvrOucHwehUGk=Taio7sirfOh5gq7KGs4iZSpK=vQ@mail.gmail.com' \
    --to=dorabpatel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=julliard@winehq.org \
    --cc=sunshine@sunshineco.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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox