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

Re: [PATCH] show-ref: add --unresolved option

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 5, 2024, 21:29 UTC
Message-ID
<xmqqzfvcz7sq.fsf@gitster.g>
In-Reply-To
<44609CA3-1215-4EAD-8456-DDD66A3B93A8@gmail.com>
John Cai <johncai86@gmail.com> writes:
> I think something like --no-dereference that was suggested in [1] could work
> since the concept of dereferencing should be familiar to the user. However, this
> maybe confusing because of the existing --dereference flag that is specific to
> tags...
True.

As a symbolic reference is like a symbolic link [*], another possibility is to use "follow", which often is used to refer to the action of reading the contents of a symbolic link and using it as the target pathname (e.g., O_NOFOLLOW flag forbids open(2) from following symbolic links). Unfortunately the checkbox feature "--follow" the "git log" has refers to an entirely different kind of following, so it is just as confusing as --dereference.

Perhaps "--readlink", if you are showing only "ref: refs/heads/main" instead of the usual object name in the output? If we are showing both, we may want to use a name that signals the optional nature of the symref part of the output, e.g., "--with-symref-target" [*].

[Footnote]
 * In fact that is how the symbolic reference started out as.  We
   literally used a symbolic link .git/HEAD that points at the
   current branch, which can be seen in v0.99~418 (git-init-db: set
   up the full default environment, 2005-05-30).
 * Yes, I know, I am terrible at naming things---my names may be
   descriptive but end up being unusably long and verbose.
Previous: John CaiNext: Phillip Wood
Message 4 of 28 in “show-ref: add --unresolved option”
  1. show-ref: add --unresolved optionJohn Cai via GitGitGadget, Mar 4, 2024
  2. Junio C HamanoMar 4, 2024
  3. John CaiMar 5, 2024
  4. Junio C HamanoMar 5, 2024
  5. Phillip WoodMar 5, 2024
  6. Kristoffer HaugsbakkMar 5, 2024
  7. Jeff KingMar 6, 2024
  8. Junio C HamanoMar 6, 2024
  9. Jeff KingMar 6, 2024
  10. Patrick SteinhardtMar 6, 2024
  11. Jeff KingMar 6, 2024
  12. Junio C HamanoMar 6, 2024
  13. Jean-Noël AvilaMar 6, 2024
  14. 0/3 show-ref: add --symbolic-name optionJohn Cai via GitGitGadget, Apr 8, 2024
  15. 2/3 refs: add referent to each_repo_ref_fnJohn Cai via GitGitGadget, Apr 8, 2024
  16. 1/3 refs: keep track of unresolved reference value in iteratorJohn Cai via GitGitGadget, Apr 8, 2024
  17. Junio C HamanoApr 8, 2024
  18. John CaiApr 9, 2024
  19. Patrick SteinhardtApr 10, 2024
  20. Junio C HamanoApr 10, 2024
  21. Patrick SteinhardtApr 11, 2024
  22. 3/3 show-ref: add --symbolic-name optionJohn Cai via GitGitGadget, Apr 8, 2024
  23. Phillip WoodApr 9, 2024
  24. John CaiApr 11, 2024
  25. phillip.wood123@gmail.comApr 12, 2024
  26. Patrick SteinhardtApr 10, 2024
  27. Junio C HamanoApr 10, 2024
  28. John CaiApr 12, 2024

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.