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

Re: [PATCH v2 3/3] show-ref: introduce --branches and deprecate --heads

From
Elijah Newren <newren@gmail.com>
Date
Jun 14, 2024, 21:34 UTC
Message-ID
<CABPp-BEM4fqU9s7_dxgi_twe_T169mGjZN9-CJRLU5cjnUi8WQ@mail.gmail.com>
In-Reply-To
<xmqq7cerdxv4.fsf@gitster.g>
On Fri, Jun 14, 2024 at 9:21 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
>
> Elijah Newren <newren@gmail.com> writes:
>
> > If we are renaming --heads to --branches, should --head also be renamed?
>
> I do not think so.  It is specifically about HEAD (the thing that
> lives above refs/ hierarchy, historically implemented as a file
> whose name is "HEAD" that is directly inside $GIT_DIR).
>
> Thanks.

I'm fine if we don't want to rename it, but I don't quite follow this particular rationale. The logic you use here seems to be about internal details ("it's the file named HEAD") and ignores what users might refer to it as ("current branch"), whereas --branches ignored the internal details ("the files under refs/heads/") and instead concentrates on what users might refer to them as ("branches") and used that as the rationale for renaming.

That said, I've almost never seen users use --head (and haven't used it myself), whereas asking for heads/branches is much more common, and I'm very happy with the change from --heads to --branches. Also, even if we do agree --head should be renamed, I'd be fine with punting it to later in order to get this improvement in now...it just seemed like a small inconsistency that I thought was worth pointing out.

Previous: Junio C HamanoNext: Elijah Newren
Message 19 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.