git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karsten Blees <karsten.blees@gmail.com>
To: Dennis Kaarsemaker <dennis@kaarsemaker.net>, git@vger.kernel.org
Cc: ingy@ingy.net
Subject: Re: [PATCH] path_treatment: also ignore $GIT_DIR if it's not .git
Date: Tue, 03 Dec 2013 16:18:34 +0100	[thread overview]
Message-ID: <529DF64A.70801@gmail.com> (raw)
In-Reply-To: <20131201190447.GA31367@kaarsemaker.net>

Am 01.12.2013 20:04, schrieb Dennis Kaarsemaker:
> We always ignore anything named .git, but we should also ignore the git
> directory if the user overrides it by setting $GIT_DIR
> 
> Reported-By: Ingy döt Net <ingy@ingy.net>
> Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
> ---
>  dir.c             | 2 +-
>  t/t7508-status.sh | 7 +++++++
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/dir.c b/dir.c
> index 23b6de4..884b37d 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -1198,7 +1198,7 @@ static enum path_treatment treat_path(struct dir_struct *dir,

The special case for ".git" is hardcoded in many places in git, including the line immediately above this diff hunk. So I figure that GIT_DIR is not meant to _rename_ the ".git" dir, but to point somewhere _outside_ the worktree (or somewhere within the .git dir).

If we want to support the rename case fully, I think there are a few more questions to answer (and a few more places to change), e.g.:
- What if GIT_DIR=.foo and someone upstream adds a ".foo" directory?
- Should it be possible to track ".git" as a normal file or directory if its not the GIT_DIR?
- What about other commands than status, e.g. does 'git clean -df' leave the GIT_DIR alone?

If we don't want to support this, though, I think it would be more approrpiate to issue a warning if GIT_DIR points to a worktree location.

  parent reply	other threads:[~2013-12-03 15:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-01  7:06 GIT_DIR not auto ignored Ingy dot Net
2013-12-01 18:08 ` Dennis Kaarsemaker
2013-12-01 18:30   ` Dennis Kaarsemaker
2013-12-01 19:04     ` [PATCH] path_treatment: also ignore $GIT_DIR if it's not .git Dennis Kaarsemaker
2013-12-01 23:02       ` Duy Nguyen
2013-12-01 23:08         ` Thomas Rast
2013-12-01 23:38           ` Dennis Kaarsemaker
2013-12-02  0:38             ` Duy Nguyen
2013-12-02  8:01               ` Dennis Kaarsemaker
2013-12-02  9:35                 ` Duy Nguyen
2013-12-02 11:40                   ` Dennis Kaarsemaker
2013-12-02 12:01                     ` Duy Nguyen
2013-12-02  1:21       ` Eric Sunshine
2013-12-03 15:18       ` Karsten Blees [this message]
2013-12-03 18:32         ` Junio C Hamano
2013-12-03 19:00           ` Karsten Blees
2013-12-03 19:07           ` Jonathan Nieder

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=529DF64A.70801@gmail.com \
    --to=karsten.blees@gmail.com \
    --cc=dennis@kaarsemaker.net \
    --cc=git@vger.kernel.org \
    --cc=ingy@ingy.net \
    /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 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).