public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Eric Raible <raible@nextest•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: "git@vger•kernel.org" <git@vger•kernel.org>
Subject: Re: Should 'git status' understand a .git containing "gitdir: dir"?
Date: Thu, 30 Jun 2011 09:48:57 -0700	[thread overview]
Message-ID: <4E0CA8F9.1080601@nextest.com> (raw)
In-Reply-To: <7vsjqrqpzn.fsf@alter.siamese.dyndns.org>

On 6/30/2011 8:49 AM, Junio C Hamano wrote:
> Eric Raible <raible@nextest•com> writes:
> 
>> The following sequence sets up a trivial repo that uses "gitdir:":
>>
>> $ git init gitdir-test
>> $ cd gitdir-test
>> $ mv .git real-git-dir
>> $ echo "gitdir: real-git-dir" > .git
>> $ git status
>>
>> Fine so far.  But git-status shows that "real-git-dir" is untracked:
>>
>> $ git status -sb
>> ## Initial commit on master
>> ?? real-git-dir/
>>
>> Which strikes one as a bit inconsistent (since other pars of git-status
>> knows to look in real-git-dir to find the index).
>>
>> Sorry - no time to investigate.
> 
> You could even have a real git dir of some completely unrelated repository
> in your working tree, it will get reported as untracked, and you would
> probably not want to track its contents, either (or you might want to if
> you are trying to be funny, I dunno).
> 
> So I do not see there is anything to investigate. What you observed looks
> perfectly expected to me, except for the "mv .git real-git-dir" bit that
> makes a situation that confuses yourself (but not git).
> .

The fact that the repo is stored in .git is an implementation detail -
and one which git-status knows about (in the normal case).

In the gidir: case one part of git status understands the details
(after all - it reads real-git-dir/index) while another part doesn't
(after all - it show the actual repo as a normal directory).

Sure, git-real-dir could be added to git-real-dir/info/exclude.
But by that logic we could insist on adding .git to .git/info/exclude.

The argument about an unrelated repo in the working tree is irrelevant -
.git wouldn't point to it, so there's nothings special about it.

But it's obviously not a big deal either way and I'm gonna drop it.

      reply	other threads:[~2011-06-30 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30  9:04 Should 'git status' understand a .git containing "gitdir: dir"? Eric Raible
2011-06-30 11:46 ` [RFC] status - don't show gitdir Fredrik Gustafsson
2011-06-30 12:32   ` Nguyen Thai Ngoc Duy
2011-06-30 15:49 ` Should 'git status' understand a .git containing "gitdir: dir"? Junio C Hamano
2011-06-30 16:48   ` Eric Raible [this message]

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=4E0CA8F9.1080601@nextest.com \
    --to=raible@nextest$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(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