git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git symbolic-ref" doesn't do a very good job

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 30, 2022, 20:38 UTC
Message-ID
<xmqqtu6y1gky.fsf@gitster.g>
In-Reply-To
<CAHk-=wg9LaHeg0UmZ90gLOaBpO-5fhoaH22iNNm=1eror95pFg@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 6 quoted lines
> t3200-branch.sh does
>
>       git symbolic-ref refs/heads/dangling-symref nowhere
>
> which really depends on that whole "git symbolic-ref does no sanity
> checking at all".
Yeah, once in the past, I thought
    git symbolic-ref refs/heads/main master

might be a way to adjust to the new world order without having me to change my workflow. I can always update master, and main follows it without me being aware of it even being there.

But it did not work.  Even worse, after doing so, running
    git update-ref refs/heads/main master
created ".git/master", which was a disaster.  Of course
    git symbolic-ref refs/heads/main refs/heads/master
would have worked.

I am not sure what workflow the "nowhere" thing is supposed to help. Of course, with s/nowhere/HEAD/, it is a perfectly sane repository immediately after "git init -b nowhere", so whatever tightening we do, we should make sure that

    git symbolic-ref refs/heads/main HEAD
keeps working.
Previous: Linus TorvaldsNext: Jeff King
Message 3 of 17 in “"git symbolic-ref" doesn't do a very good job”
  1. Linus TorvaldsJul 30, 2022
  2. Linus TorvaldsJul 30, 2022
  3. Junio C HamanoJul 30, 2022
  4. Jeff KingJul 31, 2022
  5. Jeff KingJul 31, 2022
  6. Linus TorvaldsJul 31, 2022
  7. Jeff KingAug 1, 2022
  8. Jeff KingAug 1, 2022
  9. Jeff KingAug 1, 2022
  10. Junio C HamanoAug 1, 2022
  11. Jeff KingAug 2, 2022
  12. Junio C HamanoAug 2, 2022
  13. Linus TorvaldsAug 1, 2022
  14. Junio C HamanoJul 31, 2022
  15. Jeff KingAug 1, 2022
  16. Linus TorvaldsAug 1, 2022
  17. Jeff KingAug 1, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.