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.