git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing list <git@vger.kernel.org>
Subject: Re: does "git clean" deliberately ignore "core.excludesFile"?
Date: Sat, 23 Feb 2019 13:32:16 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.21.1902231328560.2222@localhost.localdomain> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1902231912370.45@tvgsbejvaqbjf.bet>

[-- Attachment #1: Type: text/plain, Size: 2798 bytes --]

On Sat, 23 Feb 2019, Johannes Schindelin wrote:

> Hi,
>
> On Sat, 23 Feb 2019, Johannes Schindelin wrote:
>
> > On Sat, 23 Feb 2019, Junio C Hamano wrote:
> >
> > > "Robert P. J. Day" <rpjday@crashcourse.ca> writes:
> > >
> > > >   am i misreading something? and if not, is there a reason git clean
> > > > does not consult core.excludesFile?
> > >
> > > Can you ask "git log" and "git blame" whch of  core.excludesFile and
> > > "clean -x" features came earlier and by how big a difference?
> >
> > Or maybe we can have a look why the `core.excludesfile` regression test
> > case in t7300 does not catch this?
> >
> > https://github.com/git/git/blob/v2.21.0-rc2/t/t7300-clean.sh#L408-L417
>
> I actually doubt that `git clean` ignores `core.excludesFile`: in
> https://github.com/git/git/blob/v2.21.0-rc2/config.c#L1297-L1298,
> `git_default_core_config()` (which is called via the `git_clean_config()`
> -> `git_color_default_config()` -> `git_default_config()` chain from
> `cmd_clean()`) does interpret `core.excludesFile`:
>
> 	if (!strcmp(var, "core.excludesfile"))
> 		return git_config_pathname(&excludes_file, var, value);
>
> Then, `cmd_clean()` goes on to parse the options, setting the `ignored`
> variable upon `-x` and then doing
> [this](https://github.com/git/git/blob/v2.21.0-rc2/builtin/clean.c#L957-L958):
>
> 	if (!ignored)
> 		setup_standard_excludes(&dir);
>
> This function specifically looks at `excludes_file` in
> https://github.com/git/git/blob/v2.21.0-rc2/dir.c#L2481-L2483:
>
> 	if (excludes_file && !access_or_warn(excludes_file, R_OK, 0))
> 		add_excludes_from_file_1(dir, excludes_file,
> 					 dir->untracked ? &dir->ss_excludes_file : NULL);
>
> So I am quite puzzled by the claim that `git clean` might not consult
> `core.excludesFile`.
>
> Robert, care to come up with an example demonstrating where it does not?

  sorry i wasn't clear, all i was pointing out was that "man
git-clean" *explicitly* mentioned two locations related to cleaning:

  -x
        Don’t use the standard ignore rules read from .gitignore
        (per directory) and $GIT_DIR/info/exclude, ...

without additionally *explicitly* mentioning core.excludesFile. if the
man page simply said something like, "using the standard ignore
processing" and left it at that, it would be fine, but to list two of
the locations without the third is potentially confusing.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

  reply	other threads:[~2019-02-23 18:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-23 15:11 does "git clean" deliberately ignore "core.excludesFile"? Robert P. J. Day
2019-02-23 15:28 ` Junio C Hamano
2019-02-23 18:06   ` Johannes Schindelin
2019-02-23 18:19     ` Johannes Schindelin
2019-02-23 18:32       ` Robert P. J. Day [this message]
2019-02-24  5:30         ` Junio C Hamano
2019-02-24 14:15           ` Johannes Schindelin

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

  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=alpine.LFD.2.21.1902231328560.2222@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).