Re: [PATCH v4 6/6] get_short_oid: document & warn if we ignore the type selector
- From
Jeff King <peff@peff.net>
- Date
- May 10, 2018, 16:15 UTC
- Message-ID
- <20180510161532.GB10199@sigill.intra.peff.net>
- In-Reply-To
- <20180510160322.GC6462@sigill.intra.peff.net>
On Thu, May 10, 2018 at 12:03:22PM -0400, Jeff King wrote:
Show 13 quoted lines
> And finally, your 06fa example for me shows behavior that's either
> buggy, or I'm just confused. I get:
>
> $ git rev-parse 06fa^{blob}
> error: short SHA1 06fa is ambiguous
> hint: The candidates are:
> hint: 06fa2b7c2b tag v2.1.4
> hint: 06faa52353 commit 2005-10-18 - 2005-10-18 midnight
> hint: 06fac427af blob
> hint: 06faf6ba64 tree
>
> (That 06fac blob comes Junio's refs/notes/amlog). Shouldn't the blob
> disambiguator show me just that object?Ah, I see. No, "^{blob}" does not actually pass the blob disambiguator. We only handle committish and treeish right now, and this iteration of the series omits the function to fix that.
So I think the principle of this commit is sound without that patch, but your example is not a good one anymore. :)
-Peff