{"thread":{"id":"4291","subject":"bogus \"fatal: Not a git repository\"","startedAt":"2006-05-25T15:22:42Z","lastAt":"2006-05-25T21:38:33Z","messageCount":2,"participants":["Linus Torvalds","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"20684","messageId":"Pine.LNX.4.64.0605250804390.5623@g5.osdl.org","threadId":"4291","inReplyTo":null,"subject":"bogus \"fatal: Not a git repository\"","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-25T15:22:42Z","receivedAt":"2006-05-25T15:22:42Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nI was just testing that \"git ls-remote\" change by Junio, and when you're \nnot in a git repository, it gives this totally bogus warning. The _target_ \nobviously has to be a git repository, but there's no reason why you'd have \nto be in a local git repo when doing an ls-remote.\n\nThe reason is commit 73136b2e8a8ee024320c5ac6a0f14f912432bf03 by Dscho: it \nadds calls to git-repo-config in git-parse-remote.sh to get the remote \nshorthands etc.\n\nNow, either we should just hide and ignore the error from git-repo-config \n(probably bad, because some errors _are_ valid - like git-repo-config \nfailing due to bad syntax in the config file), or we should just make \ngit-repo-config quietly handle the case of not being in a git repository.\n\nThis does the latter: just quietly accepting (and doing nothing - trying \nto set a value will result in the lock-file failing) our lot in life \nsounds better than dying with a bogus error message.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\ndiff --git a/repo-config.c b/repo-config.c\nindex 127afd7..08fc4cc 100644\n--- a/repo-config.c\n+++ b/repo-config.c\n@@ -108,7 +108,8 @@ static int get_value(const char* key_, c\n \n int main(int argc, const char **argv)\n {\n-\tsetup_git_directory();\n+\tint nongit = 0;\n+\tsetup_git_directory_gently(&nongit);\n \n \twhile (1 < argc) {\n \t\tif (!strcmp(argv[1], \"--int\"))\n"},{"id":"20710","messageId":"Pine.LNX.4.63.0605252336590.31700@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4291","inReplyTo":"Pine.LNX.4.64.0605250804390.5623@g5.osdl.org","subject":"Re: bogus \"fatal: Not a git repository\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-25T21:38:33Z","receivedAt":"2006-05-25T21:38:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 25 May 2006, Linus Torvalds wrote:\n\n> The reason is commit 73136b2e8a8ee024320c5ac6a0f14f912432bf03 by Dscho: it \n> adds calls to git-repo-config in git-parse-remote.sh to get the remote \n> shorthands etc.\n\nYes, I did not think of that special case. Sorry. If you need it, here is \nAcked-By: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\nCiao,\nDscho\n"}]}