From d8e2918d02120282dc6dcd4a1ff8493a61b2bd94 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 8 Oct 2017 12:20:03 +0200 Subject: [PATCH 200/325] sys/conf/newvers.sh: Fix detection of dirty git working trees Previously the .git directory was compared to the index which always resulted in the -dirty postfix getting added to the git revision: [fk@electrobsd /usr/src]$ git status On branch electrobsd nothing to commit, working tree clean [fk@electrobsd /usr/src]$ (cd /usr/obj/usr/src/sys/ELECTRO_BEER/ && sh -x /usr/src/sys/conf/newvers.sh 2>&1 | egrep 'VERINFO|work-tree') + /usr/local/bin/git '--git-dir=/usr/src/.git' '--work-tree=/usr/src/.git/objects/..' diff-index --name-only HEAD + VERINFO='ElectroBSD 11.1-STABLE #6 r324410+9c511ceaf6cf(electrobsd)-dirty: Sun Oct 8 12:29:36 CEST 2017' Obtained from: ElectroBSD --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 782021850741..5bf092a9a8d5 100755 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -223,7 +223,7 @@ if [ -n "$git_cmd" ] ; then if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then git="${git_b}-${git}" fi - if $git_cmd --work-tree=${VCSTOP} diff-index \ + if $git_cmd --work-tree=${VCSTOP%/objects}/.. diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" modified=true -- 2.32.0