All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Mason <michael.w.mason@intel.com>
To: marc.herbert@intel.com
Cc: andy.work@nglowry.com, git@vger.kernel.org, gitster@pobox.com,
	josh@joshtriplett.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, lists@nerdbynature.de,
	michael.w.mason@intel.com, peff@peff.net,
	nico-linuxsetlocalversion@schottelius.org
Subject: Re: Wrong -dirty suffix set by setlocalversion (was: BUG in git diff-index)
Date: Thu, 24 May 2018 16:03:34 -0700	[thread overview]
Message-ID: <20180524230334.12452-1-michael.w.mason@intel.com> (raw)
In-Reply-To: <89d82c84-7a3b-9c4c-679e-a7a723669592@intel.com>

How about something like this? It ignores attributes that should have no
bearing on whether the kernel is considered dirty. Copied trees with no other
changes would no longer be marked with -dirty. Plus it works on read-only
media since no index updating is required.

Would this also be considered kosher, at least for the purposes of
setlocalversion?

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 71f39410691b..9da4c5e83285 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -73,8 +73,10 @@ scm_version()
 			printf -- '-svn%s' "`git svn find-rev $head`"
 		fi
 
-		# Check for uncommitted changes
-		if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
+		# Check for uncommitted changes. Only check mtime and size.
+       # Ignore insequential ctime, uid, gid and inode differences.
+		if git -c "core.checkstat=minimal" diff-index --name-only HEAD | \
+				grep -qv "^scripts/package"; then
 			printf '%s' -dirty
 		fi
 

  reply	other threads:[~2018-05-24 23:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 12:39 BUG in git diff-index Andy Lowry
2016-03-31 13:57 ` Carlos Martín Nieto
2016-03-31 14:05 ` Jeff King
2016-03-31 14:12   ` Andy Lowry
2016-03-31 14:27     ` Jeff King
2016-03-31 19:30       ` Andy Lowry
2016-03-31 20:39         ` Junio C Hamano
2017-09-26 19:46           ` Marc Herbert
2017-09-26 20:11             ` Eric Wong
2017-09-26 23:27               ` Google indexing https://public-inbox.org/git (was: BUG in git diff-index) Marc Herbert
2017-09-27 21:06             ` Wrong -dirty suffix set by setlocalversion " Marc Herbert
2018-05-24 23:03               ` Mike Mason [this message]
2018-05-25  3:50                 ` Marc Herbert

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=20180524230334.12452-1-michael.w.mason@intel.com \
    --to=michael.w.mason@intel.com \
    --cc=andy.work@nglowry.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists@nerdbynature.de \
    --cc=marc.herbert@intel.com \
    --cc=nico-linuxsetlocalversion@schottelius.org \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.