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

Re: [PATCH RFC] git describe without refs distinguishes dirty working tree

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 16, 2009, 17:39 UTC
Message-ID
<20091016173902.GT10505@spearce.org>
In-Reply-To
<dffdbd190910160812h6d6a876el8261a622b5439b30@mail.gmail.com>
Jean Privat <jean@pryen.org> wrote:
Show 17 quoted lines
> git describe without refs still works on HEAD but append "-dirty" if the
> working three is dirty. If the working tree is clean, nothing is appended.
> 
> Previous behavior can be achieved by specifying "HEAD".
> 
> Many build scripts use `git describe` to produce a version number.
> However, additional git commands are required to distinguish builds done
> with a clean tree from builds done with a dirty tree.
> This patch helps the writing of these scripts since `git describe` do
> the intended thing.
> 
> This new behavior could affect existing scripts by producing version
> number like v1.0.4-14-g2414721-dirty-dirty.
> These scripts could be easily fixed by explicitly using HEAD when calling
> `git describe` and works with any version of git.
> 
> Signed-off-by: Jean Privat <jean@pryen.org>
Yea, I think this is reasonable and sane thing to do.
Acked-by: Shawn O. Pearce <spearce@spearce.org>
> Note that documentation of `git describe` did not mentioned the behavior
> of the command when no committish is specified.
> However, since it is still a behavior change. If the patch is accepted,
> it could target version 1.7.

Yea, 1.7 may be safer for this, but also many scripts are based on the GIT-VERSION-GEN in git.git which uses HEAD as an explicit argument. So they might actually be OK with this change.

-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 8 in “git describe without refs distinguishes dirty working tree”
  1. git describe without refs distinguishes dirty working treeJean Privat, Oct 16, 2009
  2. Junio C HamanoOct 16, 2009
  3. Shawn O. PearceOct 16, 2009
  4. Junio C HamanoOct 16, 2009
  5. Jean PrivatOct 16, 2009
  6. Shawn O. PearceOct 16, 2009
  7. Junio C HamanoOct 16, 2009
  8. Nicolas PitreOct 17, 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.