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

Re: [PATCH 2/2] completion: enhance "current branch" display

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 10, 2009, 21:18 UTC
Message-ID
<20090510211818.GA30527@spearce.org>
In-Reply-To
<7vvdo91glm.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Introduce GIT_PS1_DESCRIBE option you can set to "contains", "branch", or
> "describe" to tweak the way how a detached HEAD is described.
> 
> The default behaviour is to describe only exact match with some tag
> (otherwise use the first 7 hexdigits) as before.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> 
>  * I do not think the new modes based on name-rev (aka "--contains") are
>    much useful if you do your own development while on a detached HEAD,
>    but they probably are useful for tourists who sightsee.
Yea, both patches are sensible.

IIRC the desire for name-rev was for detached HEAD in contexts like what git submodule produce. If you are sitting on a tagged version in a submodule, its nice to see that in your prompt. Since you aren't developing there right now, there is no branch, and you are just sightseeing.

This feature may have started at my prior job, where we had our own git submodule like tool integrated with our build system, that predated git submodule. But its also still really useful with say the Android Open Source Project, where users have 150 or so git repositories, all on detached HEADs, most pointing at an annotated tag.

-- 
Shawn.
Previous: Johannes Sixt
Message 5 of 5 in “completion: enhance "current branch" display”
  1. 2/2 completion: enhance "current branch" displayJunio C Hamano, May 10, 2009
  2. Johannes SixtMay 10, 2009
  3. Michal NazarewiczMay 10, 2009
  4. Johannes SixtMay 10, 2009
  5. Shawn O. PearceMay 10, 2009

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.