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

Re: [PATCH] revisions: add @{default} shorthand for default branch

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 30, 2026, 21:56 UTC
Message-ID
<xmqqpl6q69z8.fsf@gitster.g>
In-Reply-To
<20260130205830.45806-1-haraldnordgren@gmail.com>
Harald Nordgren <haraldnordgren@gmail.com> writes:
Show 5 quoted lines
> I pushed a WIP with some of these ideas now, not intended as the final
> thing.
>
>
> Harald

Meaning we should feel free to ignore v3 and possibly a few later versions, until we hear from you?

I was writing the following as v3 review, but I guess these are comments on a version not for public consumption, so ...

--- >8 ---

I'd rather not see you use "primary" for what init.defaultBranch specifies, which already has a good name, "default". If you are using a different concept, like:

 * learn the remote @{upstream} for the current branch (for
   "@{primary}") or the named branch (for "$name@{primary}"), and
   then
 * look at refs/remotes/$remote/HEAD

then I would appreciate a good name to call that (which is a concept that has no good name yet, as far as I can see) and "primary" might be a good name for that new concept.

And from what I read as _your_ use case in an earlier message, init.defaultBranch aka @{default} is not what you want 999/1, yet I think what the patch implements is still that one. Puzzled...

Previous: Harald NordgrenNext: Harald Nordgren
Message 7 of 32 in “revisions: add @{default} shorthand for default branch”
  1. revisions: add @{default} shorthand for default branchHarald Nordgren via GitGitGadget, Jan 29, 2026
  2. Junio C HamanoJan 29, 2026
  3. Harald NordgrenJan 30, 2026
  4. Harald NordgrenJan 30, 2026
  5. Junio C HamanoJan 30, 2026
  6. Harald NordgrenJan 30, 2026
  7. Junio C HamanoJan 30, 2026
  8. Harald NordgrenJan 31, 2026
  9. Junio C HamanoJan 31, 2026
  10. Harald NordgrenJan 31, 2026
  11. Harald NordgrenJan 31, 2026
  12. Junio C HamanoFeb 2, 2026
  13. Harald NordgrenFeb 2, 2026
  14. Phillip WoodFeb 2, 2026
  15. Harald NordgrenFeb 2, 2026
  16. D. Ben KnobleFeb 2, 2026
  17. Harald NordgrenFeb 2, 2026
  18. Kristoffer HaugsbakkFeb 2, 2026
  19. Ben KnobleFeb 2, 2026
  20. Harald NordgrenFeb 2, 2026
  21. Junio C HamanoFeb 2, 2026
  22. Ben KnobleFeb 2, 2026
  23. Harald NordgrenFeb 2, 2026
  24. Junio C HamanoFeb 2, 2026
  25. Harald NordgrenFeb 2, 2026
  26. Harald NordgrenFeb 3, 2026
  27. Phillip WoodFeb 3, 2026
  28. Junio C HamanoFeb 2, 2026
  29. revisions: add @{default} shorthand for default branchHarald Nordgren via GitGitGadget, Jan 30, 2026
  30. Kristoffer HaugsbakkJan 30, 2026
  31. revisions: add @{primary} shorthand for primary branchHarald Nordgren via GitGitGadget, Jan 30, 2026
  32. revisions: add @{primary} shorthand for primary branchHarald Nordgren via GitGitGadget, Jan 31, 2026

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.