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

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

From
Jeff King <peff@peff.net>
Date
Feb 27, 2017, 21:46 UTC
Message-ID
<20170227214640.h2qi5znay76szm35@sigill.intra.peff.net>
In-Reply-To
<xmqqefyjnwat.fsf@gitster.mtv.corp.google.com>
On Mon, Feb 27, 2017 at 01:44:26PM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > ...  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.  
> 
> The latter should read "HEAD@{either reflog or -1 or 'upstream'}"
> 
> Or do we make HEAD@{upstream} to mean "deref HEAD to learn the
> current branch name and then take its upstream"?  If so @@{upstream}
> might logically make sense, but I do not see why @{upstream} without
> HEAD or @ is not sufficient to begin with, so...

Yes, HEAD@{upstream} and @@{upstream} are both resolved to the actual branch name. I also was puzzled whether there was any real use over just @{upstream}. But it does work, and if you had a script which looked for, say, $branch@{upstream}, you'd probably want branch=HEAD to keep working.

The "branch=@" case I am less sympathetic to, as it was mainly supposed to be a command-line convenience. But it _does_ work now.

-Peff
Previous: Junio C Hamano
Message 8 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.