Skip to content

Commit 8ef14c2

Browse files
groeckmasahir0y
authored andcommitted
Revert "scripts/setlocalversion: git: Make -dirty check more robust"
This reverts commit 6147b1c. The reverted patch results in attempted write access to the source repository, even if that repository is mounted read-only. Output from "strace git status -uno --porcelain": getcwd("/tmp/linux-test", 129) = 16 open("/tmp/linux-test/.git/index.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = -1 EROFS (Read-only file system) While git appears to be able to handle this situation, a monitored build environment (such as the one used for Chrome OS kernel builds) may detect it and bail out with an access violation error. On top of that, the attempted write access suggests that git _will_ write to the file even if a build output directory is specified. Users may have the reasonable expectation that the source repository remains untouched in that situation. Fixes: 6147b1c ("scripts/setlocalversion: git: Make -dirty check more robust" Cc: Genki Sky <sky@genki.is> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent bbcde0a commit 8ef14c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/setlocalversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ scm_version()
7474
fi
7575

7676
# Check for uncommitted changes
77-
if git status -uno --porcelain | grep -qv '^.. scripts/package'; then
77+
if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
7878
printf '%s' -dirty
7979
fi
8080

0 commit comments

Comments
 (0)