I have just discovered the --dirty
option to git describe
and it looks like it should do something very useful, i.e. append a suffix to the output of <
Git 2.13 (Q2 2017) improves a bit on that --dirty
flag with a --broken
one, since "git describe --dirty
" dies when it cannot be determined if the
state in the working tree matches that of HEAD (e.g. broken
repository or broken submodule).
See commit b0176ce (21 Mar 2017) by Stefan Beller (stefanbeller).
(Merged by Junio C Hamano -- gitster -- in commit 844768a, 27 Mar 2017)
builtin/describe
: introduce--broken
flag
git-describe
tells you the version number you're at, or errors out, e.g. when you run it outside of a repository, which may happen when downloading a tar ball instead of using git to obtain the source code.To keep this property of only erroring out, when not in a repository, severe (submodule) errors must be downgraded to reporting them gently instead of having
git-describe
error out completely.
To achieve that a flag '--broken
' is introduced, which is in the same
vein as '--dirty
' but uses an actual child process to check for dirtiness.
When that child dies unexpectedly, we'll append '-broken
' instead of
'-dirty'
.