Re: [PATCH] object-name: fix resolution of object names containing curly braces
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 4, 2025, 02:52 UTC
- Message-ID
- <xmqqa5c7nvdf.fsf@gitster.g>
- In-Reply-To
- <CABPp-BG47KNt5v3vEzPCCb+qRyz9473qPTfoOcTytb_Eis96SQ@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 9 quoted lines
>> Interesting. I wonder if this looseness was to ensure that we won't
>> mistake a colon inside "master^{/title with : a colon}" as a start
>> of a subpath, instead of asking for a commit with a title that
>> happens to have a colon in it?
>
> Yeah, good catch, my changes would for example break parsing
> master^{/object-name:}:t/t1006-cat-file.sh
>
> I'll fix that and add a testcase.I am not sure what the updated approach would be, but I kind of prefer if the parser does not have to be intimately familiar with the fact that we know about '@' and '^' as possible characters that can appear before the opening '{'. That same attitude of "We know that before a '{'" '@' is valid thing to appear, so let's special case '@'" was what got us into this exchange in the first place, and I am not confident that we now are exhaustive, knowing about '@' and '^'.
Thanks.