{"thread":{"id":"65841","subject":"Strange behavior of \"git log\" with file argument","startedAt":"2026-06-19T15:47:34Z","lastAt":"2026-06-19T17:02:12Z","messageCount":2,"participants":["Vincent Lefevre","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"545981","messageId":"20260619154448.GA769454@qaa.vinc17.org","threadId":"65841","inReplyTo":null,"subject":"Strange behavior of \"git log\" with file argument","fromName":"Vincent Lefevre","fromEmail":"vincent@vinc17.net","sentAt":"2026-06-19T15:44:48Z","receivedAt":"2026-06-19T15:47:34Z","isPatch":false,"body":"With 2.53.0 under Debian/unstable:\n\n* https://github.com/git/git.git repository\n  at 95e20213faefeb95df29277c58ac1980ab68f701\n\n\"git log git-gui/git-gui--askyesno.sh\" outputs nothing. To get logs, I\ncan add the -m option. In particular, this shows 3 non-merge commits.\n\nSo the behavior without -m seems incorrect, and at least unhelpful.\n\n* https://gitlab.inria.fr/mpfr/mpfr.git repository\n  at 74cb29f0908c2887dc8c3e6ba7a3c5a2f20710a3\n\n\"git log --reverse AUTHORS\" shows only 2 commits:\n\n  bfa9d064e1cf7a736740c73b9773eabb11da6ed7\n  5a9521d1f305268e575c4a5c4de13614acef6321\n\nwhere bfa9d064e1cf7a736740c73b9773eabb11da6ed7 corresponds to the file\ncreation and 5a9521d1f305268e575c4a5c4de13614acef6321 is unrelated to\nthe AUTHORS file:\n\n  git show 5a9521d1f305268e575c4a5c4de13614acef6321\n\ncontains nothing about AUTHORS, and \"git log AUTHORS\" does not list\nthis commit. But \"git log AUTHORS\" also lists\n\n  b28347ab59db2a99168a17c3e1804000069199aa\n\nwhich had been done *before* the AUTHORS file was created!\n\nNote: According to the git-log(1) man page, the --reverse option\nis supposed to affect only the order, not the list of commits to\nbe shown:\n\n  --reverse\n      Output the commits chosen to be shown (see Commit Limiting section\n      above) in reverse order. Cannot be combined with --walk-reflogs.\n\n-- \nVincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>\n100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>\nWork: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)\n"},{"id":"546001","messageId":"xmqqwlvujwfi.fsf@gitster.g","threadId":"65841","inReplyTo":"20260619154448.GA769454@qaa.vinc17.org","subject":"Re: Strange behavior of \"git log\" with file argument","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-19T17:02:09Z","receivedAt":"2026-06-19T17:02:12Z","isPatch":false,"body":"Vincent Lefevre <vincent@vinc17.net> writes:\n\n> \"git log git-gui/git-gui--askyesno.sh\" outputs nothing. To get logs, I\n> can add the -m option. In particular, this shows 3 non-merge commits.\n\nThis is a known joy of subtree-merge hack.\n\nYou could probably do \n\n    $ git log -- git-gui/git-gui--askyesno.sh git-gui--askyesno.sh\n\nThe thing is, in git-gui project, git-gui--askyesno.sh script is at\nthe root level of its working tree, and we are subtree-merging it in\na subdirectory.  Once the history traversal realizes that a change\nto the script came from git-gui history, it would need to be told\nthat it needs to pay attention to git-gui--askyesno.sh at the root\ntree as well.\n"}]}