[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874knrqxp9.fsf@ungleich.ch>
Date: Mon, 21 Sep 2020 11:35:30 +0200
From: Nico Schottelius <nico-linuxsetlocalversion@...ottelius.org>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Nico Schottelius <nico-linuxsetlocalversion@...ottelius.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Randy Dunlap <rdunlap@...radead.org>,
Brian Norris <briannorris@...omium.org>,
Bhaskar Chowdhury <unixbhaskar@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] scripts/setlocalversion: make git describe output
more reliable
Hey Rasmus,
Rasmus Villemoes <linux@...musvillemoes.dk> 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
Powered by blists - more mailing lists