{"thread":{"id":"6435","subject":"BUG: git --bare log HEAD","startedAt":"2007-01-19T12:02:24Z","lastAt":"2007-01-20T01:05:58Z","messageCount":4,"participants":["Han-Wen Nienhuys","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32055","messageId":"eoqc09$454$2@sea.gmane.org","threadId":"6435","inReplyTo":null,"subject":"BUG: git --bare log HEAD","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2007-01-19T12:02:24Z","receivedAt":"2007-01-19T12:02:24Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\nof course, when --bare is used, then HEAD is not ambiguous.\n\n\n[lilydev@haring .git]$ git --bare log HEAD\nfatal: ambiguous argument 'HEAD': both revision and filename\nUse '--' to separate filenames from revisions\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"32115","messageId":"Pine.LNX.4.63.0701200149010.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6435","inReplyTo":"eoqc09$454$2@sea.gmane.org","subject":"[PATCH] Do not verify filenames in a bare repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-20T00:52:16Z","receivedAt":"2007-01-20T00:52:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nFor example, it makes no sense to check the presence of a file\nnamed \"HEAD\" when calling \"git log HEAD\" in a bare repository.\n\nNoticed by Han-Wen Nienhuys.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\n\tOn Fri, 19 Jan 2007, Han-Wen Nienhuys wrote:\n\n\t> of course, when --bare is used, then HEAD is not ambiguous.\n\t> \n\t> \n\t> [lilydev@haring .git]$ git --bare log HEAD\n\t> fatal: ambiguous argument 'HEAD': both revision and filename\n\t> Use '--' to separate filenames from revisions\n\n\tNote that it would still fail in your case, since saying \"--bare\" \n\tdoes not get picked up if the current directory is named \".git\".\n\n\tI was close to sending a patch which sets the environment variable\n\t\"GIT_IS_BARE\" when calling git with \"--bare\", and checking that, \n\tbut decided against it: it is more likely you are about to shoot \n\tyourself in the foot, because real bare repositories are not named \n\t\".git\".\n\n setup.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex cc97f9f..7181560 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -95,6 +95,9 @@ void verify_non_filename(const char *prefix, const char *arg)\n \tconst char *name;\n \tstruct stat st;\n \n+\tif (is_bare_repository())\n+\t\treturn;\n+\n \tif (*arg == '-')\n \t\treturn; /* flag */\n \tname = prefix ? prefix_filename(prefix, strlen(prefix), arg) : arg;\n-- \n1.5.0.rc1.g38843-dirty\n"},{"id":"32117","messageId":"7vmz4ebjoc.fsf@assigned-by-dhcp.cox.net","threadId":"6435","inReplyTo":"Pine.LNX.4.63.0701200149010.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Do not verify filenames in a bare repository","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-20T00:56:03Z","receivedAt":"2007-01-20T00:56:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This feels very sane.  Thanks.\n\nA handful tests to make sure it catches the cases wants to catch\nand it does not hiccup with the cases it shouldn't catch would\nbe appropriate, though.\n"},{"id":"32119","messageId":"Pine.LNX.4.63.0701200205011.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6435","inReplyTo":"7vmz4ebjoc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Do not verify filenames in a bare repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-20T01:05:58Z","receivedAt":"2007-01-20T01:05:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 19 Jan 2007, Junio C Hamano wrote:\n\n> This feels very sane.  Thanks.\n\nI changed my mind. A saner check would be if the current directory starts \nwith GIT_DIR, so that even (cd .git; git show HEAD) still works.\n\n> A handful tests to make sure it catches the cases wants to catch and it \n> does not hiccup with the cases it shouldn't catch would be appropriate, \n> though.\n\nSure. I'll resend in a few minutes.\n\nCiao,\nDscho\n"}]}