Re: [PATCH v3 0/8] refs: add symref support to 'git-update-ref'
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Apr 25, 2024, 21:12 UTC
- Message-ID
- <CAOLa=ZStA8tyA=COVM+7Cvr6W5BmPaesgMk6NSHpr5w+Ve08BQ@mail.gmail.com>
- In-Reply-To
- <Zin67FKk6XXOotQh@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 22 quoted lines
> On Wed, Apr 24, 2024 at 09:25:27AM -0700, Karthik Nayak wrote:
>> Jeff King <peff@peff.net> writes:
>> > On Tue, Apr 23, 2024 at 11:28:10PM +0200, Karthik Nayak wrote:
> [snip]
>> Also on a sidenote, it's worth considering that with the direction of
>> [2], we could also extrapolate to introduce {verify, update, create,
>> delete} v2, which support both symrefs and regular refs. But require
>> explicit types from the user:
>>
>> update-v2 SP <ref> NUL (oid <new-oid> | ref <new-target>) NUL
>> [(oid <old-oid> | ref <old-target>)] NUL
>> create-v2 SP <ref> NUL (oid <new-oid> | ref <new-target>) NUL
>> delete-v2 SP <ref> NUL [(oid <old-oid> | ref <old-target>)] NUL
>> verify-v2 SP <ref> NUL [(oid <old-oid> | ref <old-target>)] NUL
>>
>> This is similar to the v3 patches I've currently sent out, in that it
>> would also allow cross operations between regular refs and symrefs.
>
> One could put this new syntax behind a feature flag to avoid the "-v2"
> suffixes, e.g. `git update-ref --with-symrefs`. But I'm not sure whether
> this would be beneficial.
>Yeah, me neither. I mean it doesn't provide any new functionality. The only usecase we're missing currently (with old + symref-* commands), is that we have no way to convert a symref to a regular ref while checking the old_value. This could however simply be solved by introducing a new `symref-convert` command.