git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug report - Apple git
@ 2025-01-13 14:23 André de Castro
  2025-01-13 16:32 ` Kristoffer Haugsbakk
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: André de Castro @ 2025-01-13 14:23 UTC (permalink / raw)
  To: git

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".

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug report - Apple git
  2025-01-13 14:23 Bug report - Apple git André de Castro
@ 2025-01-13 16:32 ` Kristoffer Haugsbakk
       [not found]   ` <B50229FA-0C33-4DFD-B8D9-79F30D616F86@gmail.com>
  2025-01-13 16:35 ` Torsten Bögershausen
  2025-01-14 21:57 ` D. Ben Knoble
  2 siblings, 1 reply; 6+ messages in thread
From: Kristoffer Haugsbakk @ 2025-01-13 16:32 UTC (permalink / raw)
  To: André de Castro, git

On Mon, Jan 13, 2025, at 15:23, André de Castro wrote:
> 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"

This works for me on version 2.48.0.  It seems to have been fixed in
2.43.0.  You would have to update to a newer version.

It looks like it was fixed in 4adceb5a299 (diff: fix --merge-base with
annotated tags, 2023-10-01).[1]  The intent of the error message was to
disallow non-commit-ish like trees:

    v2.48.0^{tree}

But it also rejected annotated tags instead of peeling them.

🔗 1: https://lore.kernel.org/git/20231001151845.3621551-1-hi@alyssa.is/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug report - Apple git
  2025-01-13 14:23 Bug report - Apple git André de Castro
  2025-01-13 16:32 ` Kristoffer Haugsbakk
@ 2025-01-13 16:35 ` Torsten Bögershausen
  2025-01-14 21:57 ` D. Ben Knoble
  2 siblings, 0 replies; 6+ messages in thread
From: Torsten Bögershausen @ 2025-01-13 16:35 UTC (permalink / raw)
  To: André de Castro, git

(Please no top-posting here)

On 2025-01-13 15:23, André de Castro wrote:
> 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".
>
> 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
>

Hm, I don't think that this group/mailing list takes responsibility
for binaries shipped by companies.

If you want, you can compile Git yourself to be "on par" with
what you find under other OS.
That is the good thing with open source - please let us know,
if help is needed.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug report - Apple git
       [not found]   ` <B50229FA-0C33-4DFD-B8D9-79F30D616F86@gmail.com>
@ 2025-01-13 16:50     ` André de Castro
  0 siblings, 0 replies; 6+ messages in thread
From: André de Castro @ 2025-01-13 16:50 UTC (permalink / raw)
  To: Kristoffer Haugsbakk; +Cc: git


> This works for me on version 2.48.0.  It seems to have been fixed in
> 2.43.0.  You would have to update to a newer version.
> 
> It looks like it was fixed in 4adceb5a299 (diff: fix --merge-base with
> annotated tags, 2023-10-01).[1]  The intent of the error message was to
> disallow non-commit-ish like trees:
> 
>    v2.48.0^{tree}
> 
> But it also rejected annotated tags instead of peeling them.
> 
> 🔗 1: https://lore.kernel.org/git/20231001151845.3621551-1-hi@alyssa.is/


Indeed it works here with the homebrew version (2.48.0).

Thank you for the quick reply.

> Hm, I don't think that this group/mailing list takes responsibility
> for binaries shipped by companies.
> 
> If you want, you can compile Git yourself to be "on par" with
> what you find under other OS.
> That is the good thing with open source - please let us know,
> if help is needed.


I was unsure whether this was the right place to post. Thanks for the tip.

André de Castro

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug report - Apple git
  2025-01-13 14:23 Bug report - Apple git André de Castro
  2025-01-13 16:32 ` Kristoffer Haugsbakk
  2025-01-13 16:35 ` Torsten Bögershausen
@ 2025-01-14 21:57 ` D. Ben Knoble
  2025-01-14 22:43   ` Junio C Hamano
  2 siblings, 1 reply; 6+ messages in thread
From: D. Ben Knoble @ 2025-01-14 21:57 UTC (permalink / raw)
  To: André de Castro; +Cc: git, Kristoffer Haugsbakk

On Mon, Jan 13, 2025 at 9:23 AM André de Castro
<aramosdecastro@gmail.com> wrote:
>
> 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)

>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug report - Apple git
  2025-01-14 21:57 ` D. Ben Knoble
@ 2025-01-14 22:43   ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2025-01-14 22:43 UTC (permalink / raw)
  To: D. Ben Knoble, Jiang Xin; +Cc: André de Castro, git, Kristoffer Haugsbakk

"D. Ben Knoble" <ben.knoble@gmail.com> writes:

>> What happened instead? (Actual behavior)
>> Didn't get a diff output. Got the following error instead:
>> "fatal: --merge-base only works with commits"
>> ...
> A shorter workaround is probably "git diff --merge-base
> <your-tag>^{commit} HEAD" (this is the "peeling" that Kristoffer
> references)

Thanks.  

    $ git log -S'only works with commits' ':!po/'

finds 4adceb5a (diff: fix --merge-base with annotated tags,
2023-10-01), which is v2.43.0-rc0~36^2 and v2.43 is from Nov 2023,
so this seems to be a rather ancient bug that has been already fixed
in our codebase.

The reason why I started writing this message is a bit offtopic (and
that is why Jiang is CC'ed).  We do still have that string in our
"codebase" but in po/

    $ git grep -c 'only works with commits' po/
    po/es.po:1
    po/pl.po:1
    po/pt_PT.po:1
    po/ru.po:1

I suspect there may be other strings and translations that are no
longer in use.  

Are they something we can easily remove mechanically, and if so
should we?

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-14 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13 14:23 Bug report - Apple git André de Castro
2025-01-13 16:32 ` Kristoffer Haugsbakk
     [not found]   ` <B50229FA-0C33-4DFD-B8D9-79F30D616F86@gmail.com>
2025-01-13 16:50     ` André de Castro
2025-01-13 16:35 ` Torsten Bögershausen
2025-01-14 21:57 ` D. Ben Knoble
2025-01-14 22:43   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).