Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2998135pxk; Mon, 21 Sep 2020 02:36:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyppnO2jBC+JnAt4sUk5XUmwirgAeh4Yls9ZjFZMxChGasef4Fy74FJi/H46WgQLHpGXOrL X-Received: by 2002:a50:fe07:: with SMTP id f7mr53549822edt.173.1600681014561; Mon, 21 Sep 2020 02:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600681014; cv=none; d=google.com; s=arc-20160816; b=q4wfqDP7vTr/q2Zz715Qo0qo8Bhyz0SwfmYCo7CLdnrc54ZSjtz4T8jKeETFao8nbq aVmvEnBHQyGqOU4BAniN4oQz4WA/dIrDEmIIFc8Pz30acgNi8LyG788eVTT01zTDgDjP zonomUzP51EqV2im4vGrMjoJxEeMVNobFCvLFSZUAFAW0+2cVGjWgNorL1X27HTvWR5X pOpM6pqC9zmbCjTf5GtC5ad1eB3UcxZ3y2HnySCmKV7ejY0CLU/L2pEhaNKts0PDZHtf PuZ834UYSHqs53bGGLFjfO3fP5kCiJi0DVm7/i5Mz4AmGMJUh50i2bO3gYEPEBBWT3tG GWBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references; bh=1qWUMPIcjOrxBG/DY9EpQJlm7XDAE47vicKf8oBLrxs=; b=QuUDON4yZNPDglGWmSaVVcCWI50tWdkI9JN40iFi8Y3wswE/mAAv0VN851N2fMvXPZ UPR85++giZFlUab8typ6eVcdHkN+6p1ZP++CLPg63ZkisRmpgwJuJkElLmF14RSUaaAA q9sz/PywqswE9gs9VR+7M6KL2LgwJfXm9+P2gscQeltcQJDU9T8VbsW4QLTayce66FYu Fi2eZk0oq/MMV+wzTvutqVhlA9g9/uAmhg+ZQuW+JYYh66pVv4v0p6039oUJ6b9UpOca pJukwNsI+vBaW/DMOHNisJI6TPPbRhrzFZP3gfL+ydxI8z+uKO8BT/y4eKSiWxH5zsFp rYCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si9145673ejk.665.2020.09.21.02.36.30; Mon, 21 Sep 2020 02:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbgIUJfW (ORCPT + 99 others); Mon, 21 Sep 2020 05:35:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgIUJfW (ORCPT ); Mon, 21 Sep 2020 05:35:22 -0400 Received: from smtp.ungleich.ch (smtp.ungleich.ch [IPv6:2a0a:e5c0:0:2:400:b3ff:fe39:7956]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23F35C061755 for ; Mon, 21 Sep 2020 02:35:21 -0700 (PDT) Received: from bridge.localdomain (localhost [IPv6:::1]) by smtp.ungleich.ch (Postfix) with ESMTP id 0B16A1FD81; Mon, 21 Sep 2020 11:35:16 +0200 (CEST) Received: by bridge.localdomain (Postfix, from userid 1000) id 2DCF41A60327; Mon, 21 Sep 2020 11:35:30 +0200 (CEST) References: <20200910112701.13853-1-linux@rasmusvillemoes.dk> <20200917065615.18843-1-linux@rasmusvillemoes.dk> <87pn6k384e.fsf@ungleich.ch> <73cb82c5-37fd-7fa3-5778-723337934a2b@rasmusvillemoes.dk> User-agent: mu4e 1.4.13; emacs 27.1 From: Nico Schottelius To: Rasmus Villemoes Cc: Nico Schottelius , Masahiro Yamada , Randy Dunlap , Brian Norris , Bhaskar Chowdhury , Guenter Roeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] scripts/setlocalversion: make git describe output more reliable In-reply-to: <73cb82c5-37fd-7fa3-5778-723337934a2b@rasmusvillemoes.dk> Date: Mon, 21 Sep 2020 11:35:30 +0200 Message-ID: <874knrqxp9.fsf@ungleich.ch> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Rasmus, Rasmus Villemoes writes: >> So I suggest you introduce something on the line of: >> >> ... >> num_chars=12 >> ... >> --abbrev=$num_chars > > I considered that, but it becomes quite ugly since it needs to get into > the awk script (as a 13, though perhaps we could get awk to do the +1, I > don't really speak awk), where we'd then need to use " instead of ' and > then escape the $ that are to be interpreted by awk and not the shell. No need for that, awk can read (and use) environment variables... > So I think it's more readable with hardcoding and comments explaining > why they are there; should anyone ever want to change 12. ... so that in practice you only need to change 13 to var+1 and 12 to $var. Cheers, Nico -- Modern, affordable, Swiss Virtual Machines. Visit www.datacenterlight.ch