[PATCH tip/core/rcu 2/2] kconfig: make setlocalversion -dirty check optional

From: Paul E. McKenney
Date: Fri Mar 05 2010 - 14:44:40 EST


The git commands that check for uncommitted changes can be quite
expensive, so this patch introduces an environment variable named
KBUILD_CONFIG_NO_CHECK_DIRTY to control these checks for git.
If KBUILD_CONFIG_NO_CHECK_DIRTY is unset or is set to an empty
string, the dirty checks are performed (the default). Otherwise,
KBUILD_CONFIG_NO_CHECK_DIRTY is set to some non-empty string, and the
dirty checks are omitted.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---
scripts/setlocalversion | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 46989b8..3d4ff84 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -39,13 +39,16 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
printf -- '-svn%s' "`git svn find-rev $head`"
fi

- # Update index only on r/w media
- [ -w . ] && git update-index --refresh --unmerged > /dev/null
-
- # Check for uncommitted changes
- if git diff-index --name-only HEAD | grep -v "^scripts/package" \
- | read dummy; then
- printf '%s' -dirty
+ if [ -z "$KBUILD_CONFIG_NO_CHECK_DIRTY" ]; then
+ # Update index only on r/w media
+ [ -w . ] && git update-index --refresh --unmerged > /dev/null
+
+ # Check for uncommitted changes
+ if git diff-index --name-only HEAD \
+ | grep -v "^scripts/package" \
+ | read dummy; then
+ printf '%s' -dirty
+ fi
fi

# All done with git
--
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/