{"thread":{"id":"44111","subject":"[Bug] Custom git-dir directory shouldn't be listed as “untracked”","startedAt":"2016-09-19T14:26:47Z","lastAt":"2016-09-19T17:45:37Z","messageCount":2,"participants":["Nicolas Cuillery","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"302140","messageId":"CACmQg1hE=ytaatDfUJLkhL0p5c43wZZvgt+8pc5zoo0YFdQw6A@mail.gmail.com","threadId":"44111","inReplyTo":null,"subject":"[Bug] Custom git-dir directory shouldn't be listed as “untracked”","fromName":"Nicolas Cuillery","fromEmail":"nicolas.cuillery@gmail.com","sentAt":"2016-09-19T14:26:42Z","receivedAt":"2016-09-19T14:26:47Z","isPatch":false,"sender":{"key":"nicolas.cuillery@gmail.com","avatar":null},"body":"Hi, I want to create a local repository with a custom dir name instead\nof \".git\", I used the env vars GIT_DIR and WORK_TREE:\n>export GIT_DIR=\".customgitdir\"\n>export GIT_WORK_TREE=\".\"\n\nThen I created a repo in an empty directory:\n>$ git init\n>Initialized empty Git repository in XXXXXXXXX/.customgitdir/\n\nThen I ran git status:\n>$ git status\n>On branch master\n>\n>Initial commit\n>\n>Untracked files:\n>  (use \"git add <file>...\" to include in what will be committed)\n>\n>    .customgitdir/\n>\n>nothing added to commit but untracked files present (use \"git add\" to track)\n\nThe local repo directory listed as \"untracked files\" which is a\nproblem when using \"git add .\" afterwards.\n\nWhen using the default directory \".git\", it logically doesn't appear\nin the \"git status\" command's output. Don't you think it should be the\nsame when using a custom dir name ?\n\nGit version 2.6.4 on MacOSX 10.11\n\nRegards,\nNicolas\n"},{"id":"302156","messageId":"xmqqeg4fg4w6.fsf@gitster.mtv.corp.google.com","threadId":"44111","inReplyTo":"CACmQg1hE=ytaatDfUJLkhL0p5c43wZZvgt+8pc5zoo0YFdQw6A@mail.gmail.com","subject":"Re: [Bug] Custom git-dir directory shouldn't be listed as “untracked”","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-19T17:45:29Z","receivedAt":"2016-09-19T17:45:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Cuillery <nicolas.cuillery@gmail.com> writes:\n\n> When using the default directory \".git\", it logically doesn't appear\n> in the \"git status\" command's output. Don't you think it should be the\n> same when using a custom dir name ?\n\nNot really.\n\nGIT_DIR=<there> mechanism was never meant to be used to name a\ndirectory that sitsinside your working tree (an exception is if it\nis actually \".git\" at the top).\n"}]}