History

kbuild: fix scripts/setlocalversion to avoid erroneous -dirty tag

If git's index file is out of date, and some files have been touched such that their timestamp doesn't what is in the index, "git diff-index HEAD" may show that a particular file is dirty, when in fact it really isn't. Running "git update-index" will update the index to avoid these false positives.

Theodore Ts'o committed 19 years ago

Commit 4e7434f1 parent d8824211 file · +1 −0Browse files

Showing the changes to scripts/setlocalversion (1 of 1 file). Show all

Unified · Split

scripts/setlocalversion+1−0
@@ -16,6 +16,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then · 15 unmodified lines
16 fi16 fi
17 17
18 # Are there uncommitted changes?18 # Are there uncommitted changes?
19 git update-index --refresh --unmerged > /dev/null
19 if git diff-index HEAD | read dummy; then20 if git diff-index HEAD | read dummy; then
20 printf '%s' -dirty21 printf '%s' -dirty
21 fi22 fi