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

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2017, 21:19 UTC
Message-ID
<xmqqshmzuyam.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170227205151.rjhod347ddhmdmxp@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> I suspect there are a lot of other places that are less clear cut. E.g.,
> I think just:
>
>   git branch foo bar
>
> will put "foo" through the same interpretation. So you could do:
>
>   git branch -f @{-1} bar
>
> Is that insane? Maybe. But it does work now.
No, it _is_ very sensible, so is "git checkout -B @{-1} <someplace>"

Perhaps interpret-branch-name that does not error out when given "@" is what is broken? I suspect that calling interpret_empty_at() from that function is fundamentally flawed. The "@" end user types never means refs/heads/HEAD, and HEAD@{either reflog or -1} would not mean anything that should be taken as a branch_name, either.

So perhaps what interpret_empty_at() does is necessary for the "four capital letters is too many to type, so just type one key while holding a shift", but it should be called from somewhere else, and not from interpret_branch_name()?

Previous: Jeff KingNext: Jeff King
Message 4 of 8 in “t6300: avoid creating refs/heads/HEAD”
  1. t6300: avoid creating refs/heads/HEADJeff King, Feb 27, 2017
  2. Junio C HamanoFeb 27, 2017
  3. Jeff KingFeb 27, 2017
  4. Junio C HamanoFeb 27, 2017
  5. Jeff KingFeb 27, 2017
  6. Junio C HamanoFeb 27, 2017
  7. Junio C HamanoFeb 27, 2017
  8. Jeff KingFeb 27, 2017

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.