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

[PATCH 0/3] Branches are branches and not heads

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2024, 20:05 UTC
Message-ID
<20240603200539.1473345-1-gitster@pobox.com>

Back when Git started, we used the word "head" to mean the tip of possibly multiple histories, and that is where the name of the hierarchy .git/refs/heads/ came from. But these days we call these entities "branches" in human terms, and "head" is still used to refer to the tip of the history each of these branches represent.

When asking "git ls-remote" or "git show-ref" to limit their output to branches (as opposed to showing any ref), we use "--heads" for historical reasons, but give the option a more human friendly name "--branches", and demote "--heads" to the status of a deprecated synonym. This would eventually allow us to remove them at the breaking version boundary.

Junio C Hamano (3):
  refs: call branches branches
  ls-remote: introduce --branches and deprecate --heads
  show-ref: introduce --branches and deprecate --heads
 Documentation/git-ls-remote.txt | 12 +++++++-----
 Documentation/git-show-ref.txt  | 18 ++++++++++--------
 builtin/ls-remote.c             | 25 ++++++++++++++++++++++---
 builtin/show-ref.c              | 33 ++++++++++++++++++++++++++-------
 connect.c                       |  4 ++--
 remote.h                        |  2 +-
 t/t1403-show-ref.sh             | 22 ++++++++++++++--------
 t/t5512-ls-remote.sh            | 30 +++++++++++++++++++++++++-----
 8 files changed, 107 insertions(+), 39 deletions(-)
-- 
2.45.2-404-g9eaef5822c
Next: Junio C Hamano
Message 1 of 22 in “Branches are branches and not heads”
  1. 0/3 Branches are branches and not headsJunio C Hamano, Jun 3, 2024
  2. 1/3 refs: call branches branchesJunio C Hamano, Jun 3, 2024
  3. Eric SunshineJun 3, 2024
  4. 2/3 ls-remote: introduce --branches and deprecate --headsJunio C Hamano, Jun 3, 2024
  5. Rubén JustoJun 3, 2024
  6. Eric SunshineJun 3, 2024
  7. Junio C HamanoJun 3, 2024
  8. 3/3 show-ref: introduce --branches and deprecate --headsJunio C Hamano, Jun 3, 2024
  9. Rubén JustoJun 3, 2024
  10. Patrick SteinhardtJun 4, 2024
  11. 0/3 Branches are branches and not headsJunio C Hamano, Jun 4, 2024
  12. 1/3 refs: call branches branchesJunio C Hamano, Jun 4, 2024
  13. 2/3 ls-remote: introduce --branches and deprecate --headsJunio C Hamano, Jun 4, 2024
  14. Patrick SteinhardtJun 6, 2024
  15. Junio C HamanoJun 6, 2024
  16. 3/3 show-ref: introduce --branches and deprecate --headsJunio C Hamano, Jun 4, 2024
  17. Elijah NewrenJun 14, 2024
  18. Junio C HamanoJun 14, 2024
  19. Elijah NewrenJun 14, 2024
  20. Elijah NewrenJun 14, 2024
  21. Junio C HamanoJun 14, 2024
  22. Patrick SteinhardtJun 6, 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.