Commit 8ef14c2c authored by Guenter Roeck's avatar Guenter Roeck Committed by Masahiro Yamada
Browse files

Revert "scripts/setlocalversion: git: Make -dirty check more robust"

This reverts commit 6147b1cf.

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: 6147b1cf

 ("scripts/setlocalversion: git: Make -dirty check more robust"
Cc: Genki Sky <>
Signed-off-by: default avatarGuenter Roeck <>
Reviewed-by: default avatarBrian Norris <>
Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <>
parent bbcde0a7
......@@ -74,7 +74,7 @@ scm_version()
# Check for uncommitted changes
if git status -uno --porcelain | grep -qv '^.. scripts/package'; then
if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
printf '%s' -dirty
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment