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

Re: git status doesn't ignore GIT_DIR directory?

From
Duy Nguyen <pclouds@gmail.com>
Date
May 23, 2015, 11:42 UTC
Message-ID
<CACsJy8C2LHVrZ-MPupz2_BbE-5m7_fA7qK5HdUa9GR30y8YNPw@mail.gmail.com>
In-Reply-To
<20150523053900.GA2364@glandium.org>
On Sat, May 23, 2015 at 12:39 PM, Mike Hommey <mh@glandium.org> wrote:
Show 13 quoted lines
> On Sat, May 23, 2015 at 09:22:56AM +0700, Duy Nguyen wrote:
>> --- a/Documentation/git.txt
>> +++ b/Documentation/git.txt
>> @@ -691,6 +691,9 @@ Git so take care if using Cogito etc.
>>       specifies a path to use instead of the default `.git`
>>       for the base of the repository.
>>       The '--git-dir' command-line option also sets this value.
>> ++
>> +Note that if GIT_DIR is set explicitly to a directory inside working
>> +tree, the directory name must be ".git".
>
> Isn't the requirement that it _ends_ with ".git" (that is,
> GIT_DIR=/path/to/foo.git would work)

If $GIT_DIR points to somewhere inside worktree, ".git" exactly (it's strcmp(), not ends_with()) is the only exception. If it points outside worktree, the directory name could be anything.

-- 
Duy
Previous: Mike HommeyNext: Junio C Hamano
Message 7 of 10 in “git status doesn't ignore GIT_DIR directory?”
  1. Thorsten von EickenMay 23, 2015
  2. Junio C HamanoMay 23, 2015
  3. Duy NguyenMay 23, 2015
  4. Thorsten von EickenMay 23, 2015
  5. Duy NguyenMay 23, 2015
  6. Mike HommeyMay 23, 2015
  7. Duy NguyenMay 23, 2015
  8. Junio C HamanoMay 23, 2015
  9. Junio C HamanoMay 23, 2015
  10. Junio C HamanoMay 23, 2015

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.