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

Re: [PATCH] glossary: extend "detached HEAD" description

From
Jakub Narębski <jnareb@gmail.com>
Date
Apr 10, 2013, 18:29 UTC
Message-ID
<5165AF74.9060508@gmail.com>
In-Reply-To
<7vfvyyo35x.fsf@alter.siamese.dyndns.org>
W dniu 10.04.2013 16:45, Junio C Hamano pisze:
Show 29 quoted lines
> Jakub Narębski <jnareb@gmail.com> writes:
> 
>> Junio C Hamano wrote:
>>
>>> diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
>>> index f928b57..69c90d1 100644
>>> --- a/Documentation/glossary-content.txt
>>> +++ b/Documentation/glossary-content.txt
>>> @@ -100,9 +100,22 @@ to point at the new commit.
>>>  
>>>  [[def_detached_HEAD]]detached HEAD::
>>>  	Normally the <<def_HEAD,HEAD>> stores the name of a
>>> -	<<def_branch,branch>>.  However, git also allows you to <<def_checkout,check out>>
>>> -	an arbitrary <<def_commit,commit>> that isn't necessarily the tip of any
>>> -	particular branch.  In this case HEAD is said to be "detached".
>>> +	<<def_branch,branch>>, and commands that operate on the
>>> +	history HEAD represents operate on the history leading to the
>>> +	tip of the branch the HEAD points at.  However, Git also
>>> +	allows you to <<def_checkout,check out>> an arbitrary
>>> +	<<def_commit,commit>> that isn't necessarily the tip of any
>>> +	particular branch.  The HEAD in such a state is called
>>> +	"detached".
>>
>> Should we also add that "git branch" output shows this situation
>> as "(no branch)"?
>>
>> Nb. this is not documented in git-branch(1) manpage either...
> 
> Sounds good. Please make it so, perhaps for both.

Err... I can try to add such documentation in git-branch(1), but shouldn't I wait for your changes to glossary before adding info about "(no branch)"?

P.S. From some StackOverflow questions the connection between "(no branch)" and detached HEAD is not clear for git newbies...

-- 
Jakub Narębski
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “glossary: extend "detached HEAD" description”
  1. glossary: extend "detached HEAD" descriptionJunio C Hamano, Apr 5, 2013
  2. Eric SunshineApr 5, 2013
  3. Jakub NarębskiApr 10, 2013
  4. Junio C HamanoApr 10, 2013
  5. Jakub NarębskiApr 10, 2013
  6. Junio C HamanoApr 10, 2013

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.