Re: [PATCH v5 1/4] object-name: make get_oid quietly return an error
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- May 9, 2025, 19:50 UTC
- Message-ID
- <aB5cbjlSKXt-uOw-@tapette.crustytoothpaste.net>
- In-Reply-To
- <xmqq4ixu4kfo.fsf@gitster.g>
On 2025-05-09 at 01:55:23, Junio C Hamano wrote:
Show 13 quoted lines
> Almost everybody else in this function hits "return -1" after > detecting that it cannot yield a valid object name, and this change > makes the oddball case do the same. > > Ideally in a distant past, we might want to remove this _GENTLY > flag, together with the code path that is not so gentle, and adjust > the callers that depend on the current behaviour (which I somehow > doubt--- they need to be prepared to deal with the error return from > other parts of the same function already). We might need to make it > possible for callers to tell which error condition we got (e.g., did > the input give it a non-existing ref? did reflog walk run out?), > but these (including to the change to just lose "die" and always go > the GENTLY code path) are totally outside the scope of this series.
Yes, I think we may have discussed doing this in the past and I originally considered doing so, only to realize that was an entire series to itself and would be pretty disruptive. Last I looked, we unfortunately relied on this case more than you might imagine.
-- brian m. carlson (they/them) Toronto, Ontario, CA