{"thread":{"id":"4022","subject":"Bug in git log","startedAt":"2006-05-02T07:51:22Z","lastAt":"2006-05-02T15:26:39Z","messageCount":4,"participants":["Matthias Kestenholz","Junio C Hamano","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"19353","messageId":"20060502075122.GA8203@spinlock.ch","threadId":"4022","inReplyTo":null,"subject":"Bug in git log","fromName":"Matthias Kestenholz","fromEmail":"lists@irregular.ch","sentAt":"2006-05-02T07:51:22Z","receivedAt":"2006-05-02T07:51:22Z","isPatch":false,"sender":{"key":"lists@irregular.ch","avatar":null},"body":"Hello list,\n\nI found a bug in the new builtin git log which I am unable to fix\nmyself.\n\nInside your git source directory, do:\n\nFirst bug using old whatchanged script (not builtin version)\n\n$ ./git-whatchanged.sh -- unresolve.c\nfatal: ambiguous argument 'unresolve.c': unknown revision or\nfilename\nUse '--' to separate filenames from revisions\n\n$ ./git-whatchanged.sh -- -- unresolve.c\n[...] gives the expected output\n\n$ git log -- unresolve.c\n$ git log -- -- unresolve.c\n$ git whatchanged -- unresolve.c\n\nboth give no output.\n\nI checked the argument parsing stage and everything seemed sane (the\nsecond double-dash was not necessary anymore)\n\nHowever, the following works as expected:\n\n$ git log -- git-log.sh\n\nIt seems that the problem shows only if there was no commit\nmodifying the asked-for file. unresolve.c is introduced in commit\nec167793d84ba7b765e1eb71b0257ce7baca2d26 and removed in the\nsubsequent commit 2bd452d3b9f62ecc3406307cd6a5553856d21ff2 and is\nnever modified.\n\n/Matthias\n\n\n-- \n:wq\n"},{"id":"19354","messageId":"7virooomve.fsf@assigned-by-dhcp.cox.net","threadId":"4022","inReplyTo":"20060502075122.GA8203@spinlock.ch","subject":"Re: Bug in git log","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-02T08:24:21Z","receivedAt":"2006-05-02T08:24:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Kestenholz <lists@irregular.ch> writes:\n\n> Inside your git source directory, do:\n>\n> First bug using old whatchanged script (not builtin version)\n>\n> $ ./git-whatchanged.sh -- unresolve.c\n> fatal: ambiguous argument 'unresolve.c': unknown revision or\n> filename\n> Use '--' to separate filenames from revisions\n>\n> $ ./git-whatchanged.sh -- -- unresolve.c\n> [...] gives the expected output\n\nThat indeed sounds funny.  I was hoping to see it myself but did\nnot reproduce for me X-<.\n\n> $ git log -- unresolve.c\n> $ git log -- -- unresolve.c\n> $ git whatchanged -- unresolve.c\n>\n> both give no output.\n\nI do not have an older version between 0.99.9m and 1.3.1, but\n1.3.1 (the current stale release) does not seem to have this\n\"double dash\" problem.  Neither the tonight's \"master\" version\n(746437) nor \"next\".\n\nWe used to have a build problem where we forgot to remove\nlibgit.a and an old object from the archive was used by\nmistake.  Could you try rm -f libgit.a and rebuild your git to\nsee if it helps?\n"},{"id":"19367","messageId":"20060502134158.GC4592@spinlock.ch","threadId":"4022","inReplyTo":"7virooomve.fsf@assigned-by-dhcp.cox.net","subject":"Re: Bug in git log","fromName":"Matthias Kestenholz","fromEmail":"lists@irregular.ch","sentAt":"2006-05-02T13:41:58Z","receivedAt":"2006-05-02T13:41:58Z","isPatch":false,"sender":{"key":"lists@irregular.ch","avatar":null},"body":"* Junio C Hamano (junkio@cox.net) wrote:\n> [...]\n> We used to have a build problem where we forgot to remove\n> libgit.a and an old object from the archive was used by\n> mistake.  Could you try rm -f libgit.a and rebuild your git to\n> see if it helps?\n> \n\nOk I did that. I also removed all files which were installed by\n'make install' and did a complete rebuild and install of the current\nmaster branch. My git version is now 1.3.1.g7464\n\nThe \"double dash\" problem is not a big deal since it only happens\nwith the deprecated shellscript-version of whatchanged.\n\nDoes anyone get some output with the following command? That was the\nbug I tried to report (sorry for my bad/convoluted english)\n\n$ git log -- unresolve.c\n\n-- \n:wq\n"},{"id":"19370","messageId":"Pine.LNX.4.64.0605020817060.4086@g5.osdl.org","threadId":"4022","inReplyTo":"20060502134158.GC4592@spinlock.ch","subject":"Re: Bug in git log","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-02T15:26:39Z","receivedAt":"2006-05-02T15:26:39Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 2 May 2006, Matthias Kestenholz wrote:\n> \n> The \"double dash\" problem is not a big deal since it only happens\n> with the deprecated shellscript-version of whatchanged.\n\nSimple enough to fix. Appended.\n\nThe problem was that \"git-rev-parse --no-flags --no-revs\" will show _just_ \nthe filenames from the argument list. That means that it will also remove \nthe \"--\" from the original. That's all well and proper, but \ngit-whatchanged had a bug, and it wouldn't separate the filename arguments \nfrom the flags by adding its own \"--\".\n\nThat bug didn't matter back when we didn't check the parsing all that \ncarefully. It does now.\n\n> Does anyone get some output with the following command? That was the\n> bug I tried to report (sorry for my bad/convoluted english)\n> \n> $ git log -- unresolve.c\n\nNow, this returns empty, and it actually does that for a reason.\n\nAlong the main path, \"unresolve.c\" has never existed. The modern \n\"git-whatchanged\" (and \"git log\") is a bit different from the old \nbig-whatchanged.\n\nThe old git-whatchanged would go through _every_ commit, because it \nliterally did\n\n\tgit-rev-list | git-diff-tree --stdin -- <paths>\n\nand thus the revision list was generated without _any_ regard for the \npaths - and every single commit shows up, whether it is relevant or not.\n\nThe new revision is based on the revision parsing thing, and the semantics \nare a bit different: it semantically does the equivalent of\n\n\tgit-rev-list <paths> | git-diff-tree --stdin -- <paths>\n\nwhich limits the revision list too on the paths.\n\nAnd yes, \"git log\" does the same.\n\nSee the discussion a few weeks ago about \"path limiting broken\", and my \npatch that suggested a \"--no-prune-merges\" flag:\n\n\thttp://www.gelato.unsw.edu.au/archives/git/0604/19180.html\n\nwhich gives more of an explanation.\n\n\t\tLinus\n\n--\ndiff --git a/git-whatchanged.sh b/git-whatchanged.sh\nindex 1fb9feb..bb73cff 100755\n--- a/git-whatchanged.sh\n+++ b/git-whatchanged.sh\n@@ -24,5 +24,5 @@ rev_list_args=$(git-rev-parse --sq --def\n diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags \"$@\") &&\n \n eval \"git-rev-list $count $rev_list_args\" |\n-eval \"git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args\" |\n+eval \"git-diff-tree --stdin --pretty -r $diff_tree_flags -- $diff_tree_args\" |\n LESS=\"$LESS -S\" ${PAGER:-less}\n"}]}