Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3204525imu; Sun, 11 Nov 2018 09:42:48 -0800 (PST) X-Google-Smtp-Source: AJdET5eLIHqLIHNf8Elw6ObBUCvOClBM27YSO+o1EzjE2m6UU8EfBc5uurg/uf9rwjPqfMhszztt X-Received: by 2002:a17:902:4c08:: with SMTP id a8-v6mr16909826ple.211.1541958168189; Sun, 11 Nov 2018 09:42:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541958168; cv=none; d=google.com; s=arc-20160816; b=kHnnN+ZGFagW9CNXtbAdKaMIwWWB/XGhPZw48Gx3Y1yGBRyXN61K35EMNekWpiPDE8 xvUJN+ZilzJCmr6x+kmFFXjbIP2pTPnPTYQt9cAdMWrxVjcbvksR3wpjTzMdEeYaOELQ 9Xeq6CskaXKv6qrdsJM23ONt6dzDxNf/PZY1LHbx2C16LvR5nveRMFURQ49zaQFxHcd7 TwwWaR/XKISuNWbawRSP7gRqM/c7FXkbk6Bs5P44sYhR1Mymud8Bud+u1kg5+LYDQdDr 9zndDRvosOCDAnKGZm6qmwu9L4eEiVG0ks4dsCLiAlvohuXodbk1u/mCWxGdYoOwV7Cj 904A== 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:cc:to:subject:from :content-transfer-encoding:mime-version:message-id:date :dkim-signature; bh=zF24z67ikq/RF5fcmpvPWHlJ7EzhH+VDv67WAKiTkZk=; b=Vc2KqRPrPcC7O8bhsVUTGO1Gz7ZNN04lPa+clanSwPgLRUHih/j/Q2Z7YB4R4V+Ghe b3BhAg13RjU18d+CQYJzU+DhcD+DGn41tO+CnteO1zGGI275ivY6HMAG7UIF7SmcrUio Z/HUohPUG2BBc/PA9u0IxvfpPH2tmEOGsyOGZZCKstwefIrLsiUb5U21VcqqiwGt0CT+ x6A7yWpVbDKqgksfPUm+RodufUwWcI7lp/xLq8n87xOlM3sZdBTAQliDK9Zo4tEtrF7Y 4+TTMqduvodxrI3OVVIQYFRT2fpKv5Y4jjSExdnxWb5h4abO0+7IKS3NhLw5MPhzaIX+ qLxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@genki.is header.s=dkim header.b="t35V/Cuf"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=genki.is Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u68-v6si685035pfa.73.2018.11.11.09.42.33; Sun, 11 Nov 2018 09:42:48 -0800 (PST) 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; dkim=pass header.i=@genki.is header.s=dkim header.b="t35V/Cuf"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=genki.is Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729379AbeKLDav (ORCPT + 99 others); Sun, 11 Nov 2018 22:30:51 -0500 Received: from genki.is ([104.200.25.21]:43348 "EHLO genki.is" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729222AbeKLDau (ORCPT ); Sun, 11 Nov 2018 22:30:50 -0500 Received: by genki.is (OpenSMTPD) with ESMTP id a751a57d; Sun, 11 Nov 2018 17:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=genki.is; h=date :message-id:mime-version:content-transfer-encoding:content-type :from:subject:to:cc:in-reply-to:references; s=dkim; bh=dgnBQf6qs x/E5md9I1XwCrwdU3A=; b=t35V/Cufr6EZHxCSGFrAtBJoyOmIamwC7O877hZr9 +iG1N6JlCxfl05Jvy7HLhMLD8JDyshrx2NZAvBLA8cOgk6chueKk7ERMeA8QL/+T W3lTgZxMNGSUuOz7yIdwoVv7hTEWyOvIm3ofAghLXS493pf4ZZll68XvKWFYwobw NwlrnOmBcInyCWdr0DL7tpHBnE2IpW1QJNsC6+A9YRy7Te2bMeCqj94Vvh4e6xX0 rBqWLJCWrL13h6UAgSglXoWbPi+3UguMbMe7yd0RQSpq7agAuPF7xmGhfkjsMXO2 k+RdGLsnGJGb96FE0w2adxuTedz1anSdENaVBTL5OPzYw== Received: by genki.is (OpenSMTPD) with ESMTPSA id 15aabc5c (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sun, 11 Nov 2018 17:41:40 +0000 (UTC) Date: Sun, 11 Nov 2018 09:41:40 -0800 Message-ID: <20181111.174140.002789201@genki.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 From: Genki Sky Subject: Re: [PATCH] scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks To: Alexander Kapshuk Cc: schwab@linux-m68k.org, briannorris@chromium.org, Masahiro Yamada , dianders@chromium.org, Guenter Roeck , lists@nerdbynature.de, linux-kernel In-Reply-To: References: <20181107022156.GA254567@google.com> <20181107184435.GA168339@google.com> <20181107.204358.257636196@genki.is> <20181107205514.GB12273@roeck-us.net> <20181107.210731.330601031@genki.is> <20181109183436.GA45531@google.com> <20181110.085826.230851261@genki.is> <20181110.201050.925673938@genki.is> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexander, On Sun, 11 Nov 2018 16:48:38 +0200, Alexander Kapshuk wrote: > Piping the output of the git command to grep and using the return status > of grep as the test condition within the if block, would be sufficient > to determine whether or not '-dirty' should be printed. > > Sample run: > % if git --no-optional-locks \ > status -uno --porcelain \ > 2>/dev/null | > grep -qv '^.. scripts/package' > then > printf '%s' -dirty > fi I don't think this works well for us. We need to check whether --no-optional-locks is available before using the output to determine whether the tree is dirty or not. If it's not available, we have to fall back on diff-index. Let me know if I'm misreading you.