git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug report - Apple git

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Jan 14, 2025, 21:57 UTC
Message-ID
<CALnO6CD35K9O=Wgotij1SiY=N50WiCODY5i-_gBBcGgD73CPjw@mail.gmail.com>
In-Reply-To
<C2871318-4745-4481-9199-72D4544ECD5C@gmail.com>

On Mon, Jan 13, 2025 at 9:23 AM André de Castro <aramosdecastro@gmail.com> wrote:

Show 24 quoted lines
>
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> Checked out a branch, ran "git diff --merge-base <some-annotated-tag> HEAD".
>
> What did you expect to happen? (Expected behavior)
> To see a normal git diff output.
>
> What happened instead? (Actual behavior)
> Didn't get a diff output. Got the following error instead:
> "fatal: --merge-base only works with commits"
>
> What's different between what you expected and what actually happened?
> I didn't get the expected diff output and got an error message instead.
>
> Anything else you want to add:
> Seems it happens when I use a tag as one of the commits for git diff
> --merge-base. This is on a macOS, with apple git.
> On Windows, with Git Bash, it works as expected.
>
> I can get this to work with "git diff --merge-base $(git rev-list -n 1
> <some-annotated-tag>) HEAD".

A shorter workaround is probably "git diff --merge-base <your-tag>^{commit} HEAD" (this is the "peeling" that Kristoffer references)

Show 24 quoted lines
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
>
>
> [System Info]
> git version:
> git version 2.39.5 (Apple Git-154)
> cpu: arm64
> no commit associated with this build
> sizeof-long: 8
> sizeof-size_t: 8
> shell-path: /bin/sh
> feature: fsmonitor--daemon
> 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
> compiler info: clang: 16.0.0 (clang-1600.0.26.6)
> libc info: no libc information available
> $SHELL (typically, interactive shell): /bin/zsh
>
>
> [Enabled Hooks]
> pre-push
>
>
-- 
D. Ben Knoble
Previous: Torsten BögershausenNext: Junio C Hamano
Message 4 of 6 in “Bug report - Apple git”
  1. André de CastroJan 13, 2025
  2. Kristoffer HaugsbakkJan 13, 2025
  3. Torsten BögershausenJan 13, 2025
  4. D. Ben KnobleJan 14, 2025
  5. Junio C HamanoJan 14, 2025
  6. André de CastroJan 13, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.