public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Duy Nguyen <pclouds@gmail•com>
Cc: Pasha Bolokhov <pasha.bolokhov@gmail•com>,
	Jonathan Nieder <jrnieder@gmail•com>,
	Git Mailing List <git@vger•kernel.org>
Subject: Re: [PATCH v3] Add an explicit GIT_DIR to the list of excludes
Date: Tue, 27 May 2014 11:04:23 -0700	[thread overview]
Message-ID: <xmqqd2ezgkt4.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CACsJy8CDeTn8h8uUn_=6ek7BJueN_1i01TB_AeH03RKnf6tNSw@mail.gmail.com> (Duy Nguyen's message of "Sat, 24 May 2014 08:41:02 +0700")

Duy Nguyen <pclouds@gmail•com> writes:

> On Sat, May 24, 2014 at 12:33 AM, Pasha Bolokhov
> <pasha.bolokhov@gmail•com> wrote:
>> When an explicit '--git-dir' option points to a directory inside
>> the work tree, git treats it as if it were any other directory.
>> In particular, 'git status' lists it as untracked, while 'git add -A'
>> stages the metadata directory entirely
>>
>> Add GIT_DIR to the list of excludes in setup_standard_excludes(),
>> while checking that GIT_DIR is not just '.git', in which case it
>> would be ignored by default, and that GIT_DIR is inside GIT_WORK_TREE
>>
>> Although an analogous comparison of any given path against '.git'
>> is done in treat_path(), this does not seem to be the right place
>> to compare against GIT_DIR. Instead, the excludes provide an
>> effective mechanism of ignoring a file/directory, and adding GIT_DIR
>> as an exclude is equivalent of putting it into '.gitignore'. Function
>> setup_standard_excludes() was chosen because that is the place where
>> the excludes are initialized by the commands that are concerned about
>> excludes
>
> I like this approach. A search of "exclude-standard" in Documentation/
> gives git-grep.txt and git-ls-files.txt. I don't know if we need to
> add something about this extra exclude rule to those .txt. If it's so
> obvious that this should be the expected behavior, then probably not.

OK, so is that an Acked/Reviewed-by?

>
> The case of "git grep --exclude-standard" is interesting because it's
> intended to work without a repository. First reaction was would
> get_git_dir() return NULL in that case. But it should return ".git" so
> we're good.

  parent reply	other threads:[~2014-05-27 18:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 17:33 [PATCH v3] Add an explicit GIT_DIR to the list of excludes Pasha Bolokhov
2014-05-23 20:42 ` Junio C Hamano
2014-05-23 22:40   ` Pasha Bolokhov
2014-05-24  1:41 ` Duy Nguyen
2014-05-27 17:16   ` Pasha Bolokhov
2014-05-28 18:53     ` Jakub Narębski
2014-05-29  2:33       ` Pasha Bolokhov
2014-05-29 10:34         ` Jakub Narębski
2014-05-27 18:04   ` Junio C Hamano [this message]
2014-05-27 21:46     ` Pasha Bolokhov

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=xmqqd2ezgkt4.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=pasha.bolokhov@gmail$(echo .)com \
    --cc=pclouds@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox