Why does `git describe -dirty` add the suffix` -dirty` when describing a clean check?

I just discovered a parameter --dirtyfor git describe, and it looks like it should do something very useful, that is, add a suffix to the output git describewhen the working tree is dirty, however this does not seem to be the case in some of my repositories:

$ git status
# On branch 8.30
nothing to commit (working directory clean)
$ git describe --dirty
8.30rel-8-g9c1cbdb-dirty

I thought this might be because the working directory is dirty with respect to the tag, but this doesn't seem to be the case:

$ git status
# On branch 1.4
nothing to commit (working directory clean)
$ git describe --tags --dirty --long
1.4rel-0-gfedfe66-dirty

hg id, Mercurial, , + , , git, git describe --dirty, , , , :

   --dirty[=<mark>]
       Describe the working tree. It means describe HEAD and appends
       <mark> (-dirty by default) if the working tree is dirty.

, --dirty, ?

, , git buckminster, nfs.


: , , , .

git diff --quiet HEAD , git describe , :

$ git status
# On branch 8.30
nothing to commit (working directory clean)
$ git describe --dirty
8.30rel-8-g9c1cbdb-dirty
$ git diff --quiet HEAD
$ git describe --dirty
8.30rel-8-g9c1cbdb

, git describe dirty, gitk " , ", , , ---- filename ----.


:. , git-describe-dirty script, git describe --dirty, , , git update-index -q --refresh, .

git describe-dirty , , , git update-index -q --refresh ; git describe --dirty .

+5
2

git 1.7.6 , git describe --dirty git update-index --refresh, . git diff --quiet HEAD , "git diff" - , , .

git commit, git 1.7.7, :

git --dirty . , , , .

, , git status . , , , , . :

% git describe --tags --dirty
v1.0.0
% touch pom.xml
% git describe --tags --dirty
v1.0.0-dirty
% git status
# On branch dev
nothing to commit (working directory clean)
% git describe --tags --dirty
v1.0.0

"git status" "git " , . git 1.7.6 :

% touch pom.xml
% git describe --tags --dirty
v1.0.0-dirty
% git update-index --refresh
% git describe --tags --dirty
v1.0.0
+8

Git 2.13 (Q2 2017) --dirty --broken, "git describe --dirty" , , HEAD (, ).

. commit b0176ce (21 2017 .) (stefanbeller).
( Junio ​​C Hamano - gitster - commit 844768a, 27 2017 .

builtin/describe: --broken

git-describe , , , . , git .

, , () git-describe.

, '--broken', '--dirty', . , '-broken' "-dirty'.

+1

All Articles