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

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t