Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2952949imm; Thu, 24 May 2018 19:47:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp10eQyAjpDVbmo6oAn9QqyHTt/Ip6Cq97rChHBjFNfh1fqygpsn1xkNETCFfH4L3YVnSZ3 X-Received: by 2002:a62:991:: with SMTP id 17-v6mr632569pfj.34.1527216450139; Thu, 24 May 2018 19:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216450; cv=none; d=google.com; s=arc-20160816; b=zHT943GqkUdPhOZ9f4DsRDvcMSBR/yz6G4ycgolQGqceC8yCQU9ec5pFvY7nMBIi6T QAb8sR5tqjm/uR0y5cJUb6xLKyABwTXdkAUMS1E9c5ZEH5WpQ2piVU/1E8ewIuNo57Xc 0HxUSzdQWumnS3oXtO3I2staPmcvfOmoLuL4y1Qin30qMGIht1blysT9uyYx1lvCNXaw j3SEa4GLF+6HiVDXpFKAZqKKLNF1IovHARF8aF0bP2UdJ89P+1/IvPyPb/QLvaR2l52Q k7nNj+8fbGrH3QY+i3iTNiuP2A37ObCdEeiB7pK4wzOv1DarQ6rpcCoHPcO2IXA6jMMt b4dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=23+YVY9pj6xXGBH+EgsFmtFesu7mpLDC/MW4zVXFsho=; b=w66gRCw71TkhI6GUZDMNX8bXTHYFBll7N8OwXj6r8DMRRwKHZXzOteco0nBhmryu6X o5NKDbsR1NXcqx3uvtx/i/PImiyHtrlwoQ3I64+3qf4RW+uNKtlT+4UCIWHj3YVdtOQv M1MOidCKdJE2cUD22xSq2xy6NEQiRwEMQViltQInBmwJUoqxjplOS8Dkpz3GzGkcb7u/ XbuzV34svg7LwZvia7gAOvNkOKOXKZLesRvhGcAc7toSY1/p2ff+dIf1ZxEBrxFAbaoH OvdCeMIEFgL5kmiQIYATXg8rSmXg5eMLGzKCrBSFyxRIgg3Hl8z3XL0HP1fy4aVSnBwf CaXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14-v6si4528126pgz.284.2018.05.24.19.47.15; Thu, 24 May 2018 19:47:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965077AbeEXXCg (ORCPT + 99 others); Thu, 24 May 2018 19:02:36 -0400 Received: from mga02.intel.com ([134.134.136.20]:40110 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935346AbeEXXCf (ORCPT ); Thu, 24 May 2018 19:02:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 May 2018 16:02:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,437,1520924400"; d="scan'208";a="53658204" Received: from mwm-dev.jf.intel.com ([10.54.75.6]) by orsmga003.jf.intel.com with ESMTP; 24 May 2018 16:02:34 -0700 From: Mike Mason 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 Message-Id: <20180524230334.12452-1-michael.w.mason@intel.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <89d82c84-7a3b-9c4c-679e-a7a723669592@intel.com> References: <89d82c84-7a3b-9c4c-679e-a7a723669592@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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