linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "scripts/setlocalversion: git: Make -dirty check more robust"
@ 2018-11-06 18:10 Guenter Roeck
  2018-11-06 19:23 ` Genki Sky
  2018-11-09 16:39 ` Masahiro Yamada
  0 siblings, 2 replies; 38+ messages in thread
From: Guenter Roeck @ 2018-11-06 18:10 UTC (permalink / raw)
  To: Genki Sky, Masahiro Yamada; +Cc: linux-kernel, Guenter Roeck

This reverts commit 6147b1cf19651c7de297e69108b141fb30aa2349.

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: 6147b1cf19651 ("scripts/setlocalversion: git: Make -dirty check more robust"
Cc: Genki Sky <sky@genki.is>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 scripts/setlocalversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 79f7dd57d571..71f39410691b 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -74,7 +74,7 @@ scm_version()
 		fi
 
 		# 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
 		fi
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2018-11-19 14:43 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 18:10 [PATCH] Revert "scripts/setlocalversion: git: Make -dirty check more robust" Guenter Roeck
2018-11-06 19:23 ` Genki Sky
2018-11-07  2:22   ` Brian Norris
2018-11-07  2:58     ` Christian Kujau
2018-11-07  3:10       ` Guenter Roeck
2018-11-07  4:00       ` Brian Norris
2018-11-07 18:44         ` Brian Norris
2018-11-07 20:43           ` Genki Sky
2018-11-07 20:55             ` Guenter Roeck
2018-11-07 21:07               ` Genki Sky
2018-11-07 21:18                 ` Doug Anderson
2018-11-07 21:26                   ` Genki Sky
2018-11-08  3:16                   ` Brian Norris
2018-11-09  2:55                     ` Masahiro Yamada
2018-11-09 18:34                       ` [PATCH] scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks Brian Norris
2018-11-09 20:43                         ` Guenter Roeck
2018-11-10  8:58                         ` Genki Sky
2018-11-10 10:42                           ` Andreas Schwab
2018-11-10 20:10                             ` Genki Sky
2018-11-11 14:48                               ` Alexander Kapshuk
2018-11-11 15:03                                 ` Alexander Kapshuk
2018-11-11 17:41                                 ` Genki Sky
2018-11-11 19:59                                   ` Alexander Kapshuk
2018-11-12  8:42                                     ` Alexander Kapshuk
2018-11-13  0:09                                       ` Brian Norris
2018-11-13  8:35                                         ` Alexander Kapshuk
2018-11-13 18:32                                           ` Brian Norris
2018-11-13 19:03                                             ` [PATCH v2] " Brian Norris
2018-11-13 19:47                                               ` Genki Sky
2018-11-13 22:03                                               ` Andreas Schwab
2018-11-15  2:06                                                 ` Brian Norris
2018-11-15  2:11                                                   ` [PATCH v3] " Brian Norris
2018-11-16 15:17                                                     ` Masahiro Yamada
2018-11-19 14:42                                                     ` Masahiro Yamada
2018-11-13 19:15                                             ` [PATCH] " Alexander Kapshuk
2018-11-09  2:55               ` [PATCH] Revert "scripts/setlocalversion: git: Make -dirty check more robust" Masahiro Yamada
2018-11-09 16:39       ` Masahiro Yamada
2018-11-09 16:39 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).