Thread (3 messages) flat view 3 messages, 1 author, 2016-06-15
DORMANTno replies

[PATCH A] GIT-VERSION-GEN: refresh the index before judging a working dir to be dirty

From: Christian Jaeger <hidden>
Date: 2016-06-15 22:45:07
Subsystem: the rest · Maintainer: Linus Torvalds

When building under the control of the "fakeroot" tool [*], as is the
case when building a Debian package using "dpkg-buildpackage
-rfakeroot", GIT-VERSION-GEN appended "-dirty" to the version number;
this happens because "git diff-index --name-only HEAD --" would report
all files as changed if they have a non-root owner/group, since they
appear as owned by root under fakeroot, leading to non-empty
output. Refreshing the index first makes the decision based on content
changes only.

[*] http://fakeroot.alioth.debian.org/

Signed-off-by: Christian Jaeger <redacted>
---
 GIT-VERSION-GEN |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index cb7cd4b..e6ff486 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -16,6 +16,7 @@ elif test -d .git -o -f .git &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
 	v[0-9]*)
+		git update-index --refresh
 		test -z "$(git diff-index --name-only HEAD --)" ||
 		VN="$VN-dirty" ;;
 	esac
-- 
1.6.0.rc2.1.g7e734
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help