From: Shawn O. Pearce Date: Fri, 16 Oct 2009 17:39:02 GMT Subject: Re: [PATCH RFC] git describe without refs distinguishes dirty working tree Message-ID: <20091016173902.GT10505@spearce.org> In-Reply-To: Jean Privat wrote: > 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 Yea, I think this is reasonable and sane thing to do. Acked-by: Shawn O. Pearce > 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.