mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: linux-kernel@vger.kernel.org
Cc: "Theodore Ts'o" <tytso@mit.edu>
Subject: [PATCH,RFC 2/3] Fix scripts/setlocalversion to avoid erroneous -dirty tag
Date: Fri,  2 Nov 2007 21:53:00 -0400	[thread overview]
Message-ID: <1194054781-16609-2-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1194054781-16609-1-git-send-email-tytso@mit.edu>

If git's index file is out of date, and some files have been touched
such that their timestamp doesn't what is in the index, "git
diff-index HEAD" may show that a particular file is dirty, when in
fact it really isn't.  Running "git status" will update the index to
avoid these false positives.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 scripts/setlocalversion |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 20711f5..bfc8c8c 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -16,6 +16,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	fi
 
 	# Are there uncommitted changes?
+	git status >& /dev/null
 	if git diff-index HEAD | read dummy; then
 		printf '%s' -dirty
 	fi
-- 
1.5.3.4.499.g1104e-dirty


  reply	other threads:[~2007-11-03  1:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-03  1:52 [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Theodore Ts'o
2007-11-03  1:53 ` Theodore Ts'o [this message]
2007-11-03  1:53   ` [PATCH,RFC 3/3] scripts/setlocalversion: Fix false positive -dirty tag caused by make-kpkg Theodore Ts'o
2008-01-03 19:55 ` [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Sam Ravnborg

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=1194054781-16609-2-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®