mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: zippel@linux-m68k.org, mingo@elte.hu, akpm@linux-foundation.org,
	torvalds@linux-foundation.org, geert@linux-m68k.org,
	elendil@planet.nl, cloos@jhcloos.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 2/2] kconfig: make setlocalversion -dirty check optional
Date: Fri,  5 Mar 2010 11:44:31 -0800	[thread overview]
Message-ID: <1267818271-23154-2-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <1267818271-23154-1-git-send-email-paulmck@linux.vnet.ibm.com>

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@linux.vnet.ibm.com>
---
 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


  reply	other threads:[~2010-03-05 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 19:43 [PATCH 0/2] v4 kconfig: place git SHA1 in .config output if in SCM Paul E. McKenney
2010-03-05 19:44 ` [PATCH tip/core/rcu 1/2] kconfig: place localversion string in .config output Paul E. McKenney
2010-03-05 19:44   ` Paul E. McKenney [this message]
2010-03-08 15:01 ` [PATCH 0/2] v4 kconfig: place git SHA1 in .config output if in SCM Michal Marek
2010-03-11  2:59   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1267818271-23154-2-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=cloos@jhcloos.com \
    --cc=elendil@planet.nl \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome