From: Phillip Wood <phillip.wood123@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
Bence Ferdinandy <bence@ferdinandy.com>,
Karthik Nayak <karthik.188@gmail.com>
Cc: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
git@vger.kernel.org
Subject: Re: with git update-ref?
Date: Sun, 13 Oct 2024 10:34:36 +0100 [thread overview]
Message-ID: <f7a7046c-020a-4365-baf4-49184bd2c60b@gmail.com> (raw)
In-Reply-To: <xmqqa5facosb.fsf@gitster.g>
On 11/10/2024 22:28, Junio C Hamano wrote:
> "Bence Ferdinandy" <bence@ferdinandy.com> writes:
>
>> On Fri Oct 11, 2024 at 22:56, Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> 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.
Didn't we add support for symbolic-refs to update-ref with
'kn/update-ref-symref'? Maybe it only works with --stdin? I've Cc'd
Karthik for clarification on how it is supposed to work.
Best Wishes
Phillip
> 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.
>
> : ask what the current state is.
> $ git symbolic-ref refs/remotes/origin/HEAD
> fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
>
> : set it
> $ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
>
> : inspect the result
> $ git symbolic-ref refs/remotes/origin/HEAD
> refs/remotes/origin/master
>
> Thanks.
>
next prev parent reply other threads:[~2024-10-13 9:34 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 20:51 ref: with git update-ref? Bence Ferdinandy
2024-10-11 20:56 ` Kristoffer Haugsbakk
2024-10-11 21:04 ` Bence Ferdinandy
2024-10-11 21:28 ` Junio C Hamano
2024-10-12 19:41 ` Bence Ferdinandy
2024-10-13 9:34 ` Phillip Wood [this message]
2024-10-13 10:07 ` Kristoffer Haugsbakk
2024-10-13 12:09 ` karthik nayak
2024-10-13 15:39 ` Kristoffer Haugsbakk
2024-10-13 20:40 ` Bence Ferdinandy
2024-10-14 15:06 ` Kristoffer Haugsbakk
2024-10-15 19:03 ` [PATCH 0/6] doc: update-ref: amend old material and discuss symrefs kristofferhaugsbakk
2024-10-15 19:03 ` [PATCH 1/6] doc: update-ref: drop “flag” kristofferhaugsbakk
2024-10-16 20:45 ` Taylor Blau
2024-10-16 22:08 ` Eric Sunshine
2024-10-16 22:09 ` Taylor Blau
2024-10-17 15:30 ` Kristoffer Haugsbakk
2024-10-17 16:31 ` Eric Sunshine
2024-10-17 18:50 ` Taylor Blau
2024-10-15 19:03 ` [PATCH 2/6] doc: update-ref: remove safety paragraphs kristofferhaugsbakk
2024-10-16 20:47 ` Taylor Blau
2024-10-15 19:03 ` [PATCH 3/6] doc: update-ref: demote symlink to last section kristofferhaugsbakk
2024-10-15 19:03 ` [PATCH 4/6] doc: update-ref: remove confusing paragraph kristofferhaugsbakk
2024-10-16 20:51 ` Taylor Blau
2024-10-16 20:55 ` Kristoffer Haugsbakk
2024-10-16 20:57 ` Taylor Blau
2024-10-15 19:03 ` [PATCH 5/6] doc: update-ref: discuss symbolic links kristofferhaugsbakk
2024-10-15 19:08 ` Kristoffer Haugsbakk
2024-10-16 20:52 ` Taylor Blau
2024-10-15 19:03 ` [PATCH 6/6] doc: mutually link update-ref and symbolic-ref kristofferhaugsbakk
2024-10-16 8:51 ` [PATCH 0/6] doc: update-ref: amend old material and discuss symrefs Bence Ferdinandy
2024-10-16 20:54 ` Taylor Blau
2024-10-16 21:00 ` Kristoffer Haugsbakk
2024-10-19 19:59 ` [PATCH v2 " kristofferhaugsbakk
2024-10-19 19:59 ` [PATCH v2 1/6] Documentation/git-update-ref.txt: drop “flag” kristofferhaugsbakk
2024-10-20 11:09 ` karthik nayak
2024-10-19 19:59 ` [PATCH v2 2/6] Documentation/git-update-ref.txt: remove safety paragraphs kristofferhaugsbakk
2024-10-20 11:13 ` karthik nayak
2024-10-20 12:30 ` Kristoffer Haugsbakk
2024-10-20 16:24 ` Kristoffer Haugsbakk
2024-10-19 19:59 ` [PATCH v2 3/6] Documentation/git-update-ref.txt: demote symlink to last section kristofferhaugsbakk
2024-10-19 19:59 ` [PATCH v2 4/6] Documentation/git-update-ref.txt: remove confusing paragraph kristofferhaugsbakk
2024-10-19 19:59 ` [PATCH v2 5/6] Documentation/git-update-ref.txt: discuss symbolic refs kristofferhaugsbakk
2024-10-19 19:59 ` [PATCH v2 6/6] Documentation: mutually link update-ref and symbolic-ref kristofferhaugsbakk
2024-10-20 11:16 ` [PATCH v2 0/6] doc: update-ref: amend old material and discuss symrefs karthik nayak
2024-10-21 20:47 ` [PATCH v3 " kristofferhaugsbakk
2024-10-21 20:47 ` [PATCH v3 1/6] Documentation/git-update-ref.txt: drop “flag” kristofferhaugsbakk
2024-10-21 20:47 ` [PATCH v3 2/6] Documentation/git-update-ref.txt: remove safety paragraphs kristofferhaugsbakk
2024-10-21 20:47 ` [PATCH v3 3/6] Documentation/git-update-ref.txt: demote symlink to last section kristofferhaugsbakk
2024-10-21 20:47 ` [PATCH v3 4/6] Documentation/git-update-ref.txt: remove confusing paragraph kristofferhaugsbakk
2024-10-21 20:47 ` [PATCH v3 5/6] Documentation/git-update-ref.txt: discuss symbolic refs kristofferhaugsbakk
2024-10-21 20:47 ` [PATCH v3 6/6] Documentation: mutually link update-ref and symbolic-ref kristofferhaugsbakk
2024-10-21 20:50 ` [PATCH v3 0/6] doc: update-ref: amend old material and discuss symrefs Taylor Blau
2024-10-12 6:25 ` ref: with git update-ref? Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7a7046c-020a-4365-baf4-49184bd2c60b@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=bence@ferdinandy.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=karthik.188@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).