From: Gregory Fong <gregory.0xf0@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>, Gregory Fong <gregory.0xf0@gmail.com>
Subject: [PATCH] scripts/setlocalversion: fix false positive -dirty tag from ctime
Date: Tue, 10 Mar 2015 16:03:09 -0700 [thread overview]
Message-ID: <1426028589-28403-1-git-send-email-gregory.0xf0@gmail.com> (raw)
git-diff-index cannot detect that a file hasn't actually changed when the
file's ctime has changed (e.g. if chmod was used but didn't actually result in
any changes), which was causing setlocalversion to incorrectly add a -dirty
tag. Run git-update-index beforehand to make sure that the index is correct.
Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
---
Quick test:
make defconfig
make prepare
chmod u+w Kbuild # any chmod that doesn't result in a change will do
CONFIG_LOCALVERSION_AUTO=y /bin/sh scripts/setlocalversion $PWD | grep -q dirty && echo "FAIL" || echo "OK"
scripts/setlocalversion | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 63d91e2..9e97364 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -45,6 +45,8 @@ scm_version()
# Check for git and a git repo.
if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
+ # Update the index
+ git update-index -q --refresh
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
# it, because this version is defined in the top level Makefile.
--
1.9.1
reply other threads:[~2015-03-10 23:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1426028589-28403-1-git-send-email-gregory.0xf0@gmail.com \
--to=gregory.0xf0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
/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®