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, 22:18 UTC
Message-ID
<xmqqa897nupx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170227214147.5ezxskhihi3cc77m@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> The "other" stuff could sometimes be useful, I guess. It's not _always_
> wrong to do:
>
>   git branch -f @{upstream} foo
>
> It depends on what your @{upstream} resolves to. Switching to just using
> interpret_nth_prior_checkout() would break the case when it resolves to
> a local branch. I'm not sure if we're OK with that or not. If we want to
> keep all the existing cases working, I think we need something like the
> "not_in_refs_heads" patch I posted elsewhere.

I haven't seen that patch, but yes, telling the caller if the returned value is meant to be used inside refs/heads/ is the right approach and makes it possible for "@{upstream}" (and just "@") to be handled sensibly in "git branch -m @{that at-mark thing}".

Previous: Jeff KingNext: Junio C Hamano
Message 6 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.