{"thread":{"id":"62798","subject":"Bug report - Apple git","startedAt":"2025-01-13T14:23:47Z","lastAt":"2025-01-14T22:43:30Z","messageCount":6,"participants":["André de Castro","Kristoffer Haugsbakk","Torsten Bögershausen","D. Ben Knoble","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"510416","messageId":"C2871318-4745-4481-9199-72D4544ECD5C@gmail.com","threadId":"62798","inReplyTo":null,"subject":"Bug report - Apple git","fromName":"André de Castro","fromEmail":"aramosdecastro@gmail.com","sentAt":"2025-01-13T14:23:33Z","receivedAt":"2025-01-13T14:23:47Z","isPatch":false,"sender":{"key":"aramosdecastro@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\nChecked out a branch, ran \"git diff --merge-base <some-annotated-tag> HEAD\".\n\nWhat did you expect to happen? (Expected behavior)\nTo see a normal git diff output.\n\nWhat happened instead? (Actual behavior)\nDidn't get a diff output. Got the following error instead:\n\"fatal: --merge-base only works with commits\"\n\nWhat's different between what you expected and what actually happened?\nI didn't get the expected diff output and got an error message instead.\n\nAnything else you want to add:\nSeems it happens when I use a tag as one of the commits for git diff\n--merge-base. This is on a macOS, with apple git.\nOn Windows, with Git Bash, it works as expected.\n\nI can get this to work with \"git diff --merge-base $(git rev-list -n 1\n<some-annotated-tag>) HEAD\".\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.39.5 (Apple Git-154)\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Darwin 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec  6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020 arm64\ncompiler info: clang: 16.0.0 (clang-1600.0.26.6)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\npre-push\n\n"},{"id":"510428","messageId":"5aae11ba-b283-4d04-9336-31d02ff41c93@app.fastmail.com","threadId":"62798","inReplyTo":"C2871318-4745-4481-9199-72D4544ECD5C@gmail.com","subject":"Re: Bug report - Apple git","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-01-13T16:32:07Z","receivedAt":"2025-01-13T16:32:45Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Mon, Jan 13, 2025, at 15:23, André de Castro wrote:\n> Checked out a branch, ran \"git diff --merge-base <some-annotated-tag> HEAD\".\n>\n> What did you expect to happen? (Expected behavior)\n> To see a normal git diff output.\n>\n> What happened instead? (Actual behavior)\n> Didn't get a diff output. Got the following error instead:\n> \"fatal: --merge-base only works with commits\"\n\nThis works for me on version 2.48.0.  It seems to have been fixed in\n2.43.0.  You would have to update to a newer version.\n\nIt looks like it was fixed in 4adceb5a299 (diff: fix --merge-base with\nannotated tags, 2023-10-01).[1]  The intent of the error message was to\ndisallow non-commit-ish like trees:\n\n    v2.48.0^{tree}\n\nBut it also rejected annotated tags instead of peeling them.\n\n🔗 1: https://lore.kernel.org/git/20231001151845.3621551-1-hi@alyssa.is/\n"},{"id":"510429","messageId":"136f18cc-7b6a-4427-a4a7-96ef073ada49@web.de","threadId":"62798","inReplyTo":"C2871318-4745-4481-9199-72D4544ECD5C@gmail.com","subject":"Re: Bug report - Apple git","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2025-01-13T16:35:41Z","receivedAt":"2025-01-13T16:35:50Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"(Please no top-posting here)\n\nOn 2025-01-13 15:23, André de Castro wrote:\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> Checked out a branch, ran \"git diff --merge-base <some-annotated-tag> HEAD\".\n>\n> What did you expect to happen? (Expected behavior)\n> To see a normal git diff output.\n>\n> What happened instead? (Actual behavior)\n> Didn't get a diff output. Got the following error instead:\n> \"fatal: --merge-base only works with commits\"\n>\n> What's different between what you expected and what actually happened?\n> I didn't get the expected diff output and got an error message instead.\n>\n> Anything else you want to add:\n> Seems it happens when I use a tag as one of the commits for git diff\n> --merge-base. This is on a macOS, with apple git.\n> On Windows, with Git Bash, it works as expected.\n>\n> I can get this to work with \"git diff --merge-base $(git rev-list -n 1\n> <some-annotated-tag>) HEAD\".\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n>\n>\n> [System Info]\n> git version:\n> git version 2.39.5 (Apple Git-154)\n> cpu: arm64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> feature: fsmonitor--daemon\n> uname: Darwin 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec  6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020 arm64\n> compiler info: clang: 16.0.0 (clang-1600.0.26.6)\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): /bin/zsh\n>\n>\n> [Enabled Hooks]\n> pre-push\n>\n\nHm, I don't think that this group/mailing list takes responsibility\nfor binaries shipped by companies.\n\nIf you want, you can compile Git yourself to be \"on par\" with\nwhat you find under other OS.\nThat is the good thing with open source - please let us know,\nif help is needed.\n\n\n\n"},{"id":"510431","messageId":"4B31DB8A-E74B-41FF-9C53-7A877D135489@gmail.com","threadId":"62798","inReplyTo":"B50229FA-0C33-4DFD-B8D9-79F30D616F86@gmail.com","subject":"Re: Bug report - Apple git","fromName":"André de Castro","fromEmail":"aramosdecastro@gmail.com","sentAt":"2025-01-13T16:50:59Z","receivedAt":"2025-01-13T16:51:14Z","isPatch":false,"sender":{"key":"aramosdecastro@gmail.com","avatar":null},"body":"\n> This works for me on version 2.48.0.  It seems to have been fixed in\n> 2.43.0.  You would have to update to a newer version.\n> \n> It looks like it was fixed in 4adceb5a299 (diff: fix --merge-base with\n> annotated tags, 2023-10-01).[1]  The intent of the error message was to\n> disallow non-commit-ish like trees:\n> \n>    v2.48.0^{tree}\n> \n> But it also rejected annotated tags instead of peeling them.\n> \n> 🔗 1: https://lore.kernel.org/git/20231001151845.3621551-1-hi@alyssa.is/\n\n\nIndeed it works here with the homebrew version (2.48.0).\n\nThank you for the quick reply.\n\n> Hm, I don't think that this group/mailing list takes responsibility\n> for binaries shipped by companies.\n> \n> If you want, you can compile Git yourself to be \"on par\" with\n> what you find under other OS.\n> That is the good thing with open source - please let us know,\n> if help is needed.\n\n\nI was unsure whether this was the right place to post. Thanks for the tip.\n\nAndré de Castro"},{"id":"510545","messageId":"CALnO6CD35K9O=Wgotij1SiY=N50WiCODY5i-_gBBcGgD73CPjw@mail.gmail.com","threadId":"62798","inReplyTo":"C2871318-4745-4481-9199-72D4544ECD5C@gmail.com","subject":"Re: Bug report - Apple git","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-01-14T21:57:16Z","receivedAt":"2025-01-14T21:57:29Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Mon, Jan 13, 2025 at 9:23 AM André de Castro\n<aramosdecastro@gmail.com> wrote:\n>\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> Checked out a branch, ran \"git diff --merge-base <some-annotated-tag> HEAD\".\n>\n> What did you expect to happen? (Expected behavior)\n> To see a normal git diff output.\n>\n> What happened instead? (Actual behavior)\n> Didn't get a diff output. Got the following error instead:\n> \"fatal: --merge-base only works with commits\"\n>\n> What's different between what you expected and what actually happened?\n> I didn't get the expected diff output and got an error message instead.\n>\n> Anything else you want to add:\n> Seems it happens when I use a tag as one of the commits for git diff\n> --merge-base. This is on a macOS, with apple git.\n> On Windows, with Git Bash, it works as expected.\n>\n> I can get this to work with \"git diff --merge-base $(git rev-list -n 1\n> <some-annotated-tag>) HEAD\".\n\nA shorter workaround is probably \"git diff --merge-base\n<your-tag>^{commit} HEAD\" (this is the \"peeling\" that Kristoffer\nreferences)\n\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n>\n>\n> [System Info]\n> git version:\n> git version 2.39.5 (Apple Git-154)\n> cpu: arm64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> feature: fsmonitor--daemon\n> uname: Darwin 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec  6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020 arm64\n> compiler info: clang: 16.0.0 (clang-1600.0.26.6)\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): /bin/zsh\n>\n>\n> [Enabled Hooks]\n> pre-push\n>\n>\n\n\n-- \nD. Ben Knoble\n"},{"id":"510548","messageId":"xmqqv7uh10fk.fsf@gitster.g","threadId":"62798","inReplyTo":"CALnO6CD35K9O=Wgotij1SiY=N50WiCODY5i-_gBBcGgD73CPjw@mail.gmail.com","subject":"Re: Bug report - Apple git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-14T22:43:27Z","receivedAt":"2025-01-14T22:43:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n>> What happened instead? (Actual behavior)\n>> Didn't get a diff output. Got the following error instead:\n>> \"fatal: --merge-base only works with commits\"\n>> ...\n> A shorter workaround is probably \"git diff --merge-base\n> <your-tag>^{commit} HEAD\" (this is the \"peeling\" that Kristoffer\n> references)\n\nThanks.  \n\n    $ git log -S'only works with commits' ':!po/'\n\nfinds 4adceb5a (diff: fix --merge-base with annotated tags,\n2023-10-01), which is v2.43.0-rc0~36^2 and v2.43 is from Nov 2023,\nso this seems to be a rather ancient bug that has been already fixed\nin our codebase.\n\nThe reason why I started writing this message is a bit offtopic (and\nthat is why Jiang is CC'ed).  We do still have that string in our\n\"codebase\" but in po/\n\n    $ git grep -c 'only works with commits' po/\n    po/es.po:1\n    po/pl.po:1\n    po/pt_PT.po:1\n    po/ru.po:1\n\nI suspect there may be other strings and translations that are no\nlonger in use.  \n\nAre they something we can easily remove mechanically, and if so\nshould we?\n\nThanks.\n"}]}