Re: [PATCH] diff: fix --merge-base with annotated tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alyssa Ross <hi@xxxxxxxxx> writes:

> Checking early for OBJ_COMMIT excludes other objects that can be
> resolved to commits, like annotated tags.  If we remove it, annotated
> tags will be resolved and handled just fine by
> lookup_commit_reference(), and if we are given something that can't be
> resolved to a commit, we'll still get a useful error message, e.g.:
>
>> error: object 21ab162211ac3ef13c37603ca88b27e9c7e0d40b is a tree, not a commit
>> fatal: no merge base found

Interesting.  0f5a1d44 (builtin/diff-index: learn --merge-base,
2020-09-20) claims that it took inspiration from "git diff A...B"
but forgot that it needs to accept any commit-ish.

With a devil's advocate hat on, I have to wonder if it is really a
useful error message to spew a long hexadecimal string when the user
would certainly have gave a more mnemonic HEAD^{tree} or something,
but the original message does not say which command line argument it
did not like anyway, so the patch is a net improvement.

Will queue.  Thanks.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux