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

Re: [RFC/PATCH] branch: name detached HEAD analogous to status

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 23, 2015, 16:24 UTC
Message-ID
<54EB545A.2040309@drmicha.warpmail.net>
In-Reply-To
<54EB436E.9060106@xiplink.com>
Marc Branchaud venit, vidit, dixit 23.02.2015 16:12:
Show 14 quoted lines
> On 15-02-22 12:38 PM, Michael J Gruber wrote:
>> "git status" carefully names a detached HEAD "at" resp. "from" a rev or
>> ref depending on whether the detached HEAD has moved since. "git branch"
>> always uses "from", which can be confusing, because a status-aware user
>> would interpret this as moved detached HEAD.
>>
>> Make "git branch" use the same logic and wording.
> 
> Except that the wording in "git branch" is more correct, especially if the
> detached HEAD contains new commits.
> 
> In other words, "at" is only correct if the detached HEAD matches the ref.
> If the HEAD has other commits, it is no longer "at" that ref but instead it
> has grown "from" it.
Sure, but that's exactly what git status does. Haven't you tried out?
And it's exactly what I suggest for git branch. It conveys more information.
> But even if the detached HEAD matches the ref, saying it came "from" that ref
> (with 0 extra commits) is still better than saying
> detached-HEAD-with-extra-commits is "at" the ref.

Why? Both are true. "at" conveys the additional information that HEAD is still at the that rev.

Michael
Previous: Marc BranchaudNext: Marc Branchaud
Message 10 of 11 in “branch: name detached HEAD analogous to status”
  1. branch: name detached HEAD analogous to statusMichael J Gruber, Feb 22, 2015
  2. Junio C HamanoFeb 22, 2015
  3. Michael J GruberFeb 23, 2015
  4. Marc BranchaudFeb 23, 2015
  5. 0/2 branch output for detached HEADMichael J Gruber, Mar 6, 2015
  6. 1/2 wt-status: refactor detached HEAD analysisMichael J Gruber, Mar 6, 2015
  7. 2/2 branch: name detached HEAD analogous to statusMichael J Gruber, Mar 6, 2015
  8. Junio C HamanoMar 6, 2015
  9. Marc BranchaudFeb 23, 2015
  10. Michael J GruberFeb 23, 2015
  11. Marc BranchaudFeb 23, 2015

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.