git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Should 'git status' understand a .git containing "gitdir: dir"?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 30, 2011, 15:49 UTC
Message-ID
<7vsjqrqpzn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4E0C3C1D.1050406@nextest.com>
Eric Raible <raible@nextest.com> writes:
Show 18 quoted lines
> 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).

Previous: Nguyen Thai Ngoc DuyNext: Eric Raible
Message 4 of 5 in “Should 'git status' understand a .git containing "gitdir: dir"?”
  1. Eric RaibleJun 30, 2011
  2. [RFC] status - don't show gitdirFredrik Gustafsson, Jun 30, 2011
  3. Nguyen Thai Ngoc DuyJun 30, 2011
  4. Junio C HamanoJun 30, 2011
  5. Eric RaibleJun 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.