{"thread":{"id":"24359","subject":"log -S with evil merges","startedAt":"2010-07-10T19:48:38Z","lastAt":"2010-07-12T06:39:50Z","messageCount":3,"participants":["Jonathan Nieder","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145278","messageId":"20100710194838.GA2315@burratino","threadId":"24359","inReplyTo":null,"subject":"log -S with evil merges","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-10T19:48:38Z","receivedAt":"2010-07-10T19:48:38Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nI was interested to know the origin of the UE_ALWAYS et al flags in\nbuiltin/reflog.c, so I asked git:\n\n ; git log --oneline -S'UE_ALWAYS' --follow builtin/reflog.c\n 81b50f3 Move 'builtin-*' into a 'builtin/' subdirectory\n 4264dc1 git reflog expire\n\nOk, clearly it was not introduced in the builtin/ move.  I guess the\nUE_ flags were part of the original ‘reflog’ implementation.  Right?\n\n ; git show 4264dc1 | grep UE_ALWAYS\n ; git show 4264dc1:builtin-reflog.c | grep UE_ALWAYS\n ;\n\nNo, that’s not it.  At this point I decided -S is broken and just did\na grep through log -p, to find that apparently this symbol was\nintroduced in builtin-reflog.c with v1.7.2-rc0~122^2 (reflog\n--expire-unreachable: special case entries in \"HEAD\" reflog,\n2010-04-09).\n\nSo why is log confused?  As far as log -S knows, because of the\nbuiltin/ move, commit v1.7.2-rc0~122 was an evil merge that produced\nthe UE_ flags in builtin/reflog.c out of thin air.  It should be\nblaming that commit, then.  With a little coaxing, it does.\n\n ; git log --format=oneline \\\n\t--first-parent -m -S'UE_ALWAYS' --follow builtin/reflog.c |\n   git name-rev --tags --stdin |\n   cut -d' ' -f2-\n (tags/v1.7.2-rc0~122) Merge branch 'jc/maint-no-reflog-expire-unreach-for-head'\n (tags/v1.7.1-rc0~76) Merge branch 'lt/deepen-builtin-source'\n (tags/v1.5.0-rc1~188) Merge branch 'jc/fsck-reflog'\n ;\n\nThe first is the culprit, the second and third the file’s renaming and\nintroduction[1].\n\nThe more logical\n\n ; git log --oneline -c -S'UE_ALWAYS' --follow builtin/reflog.c\n\ndoes not work --- it mentions _all_ merges.  Why?\n\n[1] I don’t know why ‘log -S --follow’ should feel the need to point\nthese out, but that’s a different story.\n"},{"id":"145346","messageId":"7v39vpfcte.fsf@alter.siamese.dyndns.org","threadId":"24359","inReplyTo":"20100710194838.GA2315@burratino","subject":"Re: log -S with evil merges","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-12T06:12:45Z","receivedAt":"2010-07-12T06:12:45Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> The more logical\n>\n>  ; git log --oneline -c -S'UE_ALWAYS' --follow builtin/reflog.c\n>\n> does not work --- it mentions _all_ merges.  Why?\n\nI don't think --follow, which is merely a checkbox item, is friendly to\nmost other git features.  Does it even show diff with the corresponding\nfile at the commit where filename is changed?\n"},{"id":"145348","messageId":"20100712063949.GA6301@burratino","threadId":"24359","inReplyTo":"7v39vpfcte.fsf@alter.siamese.dyndns.org","subject":"Re: log -S with evil merges","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-12T06:39:50Z","receivedAt":"2010-07-12T06:39:50Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>>  ; git log --oneline -c -S'UE_ALWAYS' --follow builtin/reflog.c\n>>\n>> does not work --- it mentions _all_ merges.  Why?\n>\n> I don't think --follow, which is merely a checkbox item, is friendly to\n> most other git features.\n\nHmm, leaving out the --follow makes it behave again.  Thanks for the tip.\n\n> Does it even show diff with the corresponding\n> file at the commit where filename is changed?\n\n $ git tag lt/deepen-builtin-source 81b50f3\n $ git diff --raw --follow lt/deepen-builtin-source^! -- builtin/reflog.c\n :100644 100644 7498210... 7498210... R100\tbuiltin-reflog.c\tbuiltin/reflog.c\n $ git diff-tree --abbrev -c --follow v1.7.2-rc0~122 -- builtin/reflog.c\n a660534e06147f8867d6c9b6c41025427a7b5c6c\n ::100644 100644 100644 f732156... fafb740... ebf610e... MR      builtin/reflog.c\n\nLooks good to me...\n"}]}