Re: with git update-ref?

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

 



On Fri Oct 11, 2024 at 23:28, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> "Bence Ferdinandy" <bence@xxxxxxxxxxxxxx> writes:
>
>> On Fri Oct 11, 2024 at 22:56, Kristoffer Haugsbakk <kristofferhaugsbakk@xxxxxxxxxxxx> wrote:
>>> `ref: refs/remotes/origin/test`? (space after colon)
>>
>> I tried a couple of variations and no:
>>
>> ❯ git update-ref --no-deref refs/remotes/origin/HEAD 'ref: refs/remotes/origin/test'
>> fatal: ref: refs/remotes/origin/test: not a valid SHA1
>> ❯ git update-ref refs/remotes/origin/HEAD 'ref: refs/remotes/origin/test'
>> fatal: ref: refs/remotes/origin/test: not a valid SHA1
>> ❯ git update-ref --no-deref refs/remotes/origin/HEAD 'ref:refs/remotes/origin/test'
>> fatal: ref:refs/remotes/origin/test: not a valid SHA1
>> ❯ git update-ref  refs/remotes/origin/HEAD 'ref:refs/remotes/origin/test'
>> fatal: ref:refs/remotes/origin/test: not a valid SHA1
>>
>> I guess the intended way of doing this is via git symbolic-ref anyway, but I'm
>> curious if this should work somehow or I'm misinterpreting the meaning of that
>> sentence.
>
> I do not think update-ref is a tool to modify a symbolic-ref.
> Moreover, the mention of "ref:" is meant to be for those who are
> overly curious for their own good and go peek into their .git/
> directory; script writers should not have to know such an
> implementation detail.

Yes, that was my impression as well, but I think it is pretty misleadning
because "It also" is preceded by an entire paragraph about what you can specify
with oids so it's easy to read as if you could specify a symbolic ref here.
Because of the --no-deref argument it makes sense to talk about symrefs, but
I'd propose to rewrite this part a bit to make it more clear. Something along
the lines of referencing gitglossary(1) (thanks Andreas) for what symrefs are
instead of explaining here and explicitly mentioning that it's git symbolic-ref
that is for manipulating symrefs.

Best,
Bence


-- 
bence.ferdinandy.com






[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