@@ -51,48 +51,12 @@ _scm_version()
5151 echo " +"
5252 return
5353 fi
54- # If we are past a tagged commit (like
55- # "v2.6.30-rc5-302-g72357d5"), we pretty print it.
56- #
57- # Ensure the abbreviated sha1 has exactly 12
58- # hex characters, to make the output
59- # independent of git version, local
60- # core.abbrev settings and/or total number of
61- # objects in the current repository - passing
62- # --abbrev=12 ensures a minimum of 12, and the
63- # awk substr() then picks the 'g' and first 12
64- # hex chars.
65- if atag=" $( git describe --abbrev=12 2> /dev/null) " ; then
66- echo " $atag " | awk -F- ' {printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}'
67-
68- # If we don't have a tag at all we print -g{commitish},
69- # again using exactly 12 hex chars.
70- else
71- head=" $( echo $head | cut -c1-12) "
72- printf ' %s%s' -g $head
73- fi
7454 fi
7555
7656 # Is this git on svn?
7757 if git config --get svn-remote.svn.url > /dev/null; then
7858 printf -- ' -svn%s' " ` git svn find-rev $head ` "
7959 fi
80-
81- # Check for uncommitted changes.
82- # First, with git-status, but --no-optional-locks is only
83- # supported in git >= 2.14, so fall back to git-diff-index if
84- # it fails. Note that git-diff-index does not refresh the
85- # index, so it may give misleading results. See
86- # git-update-index(1), git-diff-index(1), and git-status(1).
87- if {
88- git --no-optional-locks status -uno --porcelain 2> /dev/null ||
89- git diff-index --name-only HEAD
90- } | grep -qvE ' ^(.. )?scripts/package' ; then
91- printf ' %s' -dirty
92- fi
93-
94- # All done with git
95- return
9660 fi
9761
9862 # Check for mercurial and a mercurial repo.
0 commit comments