git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Carlo Arenas <carenas@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	git@vger.kernel.org, "Eric Sunshine" <sunshine@sunshineco.com>,
	"Phillip Wood" <phillip.wood@talktalk.net>
Subject: Re: [PATCH v2] CI: select CC based on CC_PACKAGE (again)
Date: Thu, 21 Apr 2022 12:47:42 -0700	[thread overview]
Message-ID: <xmqqr15qgqw1.fsf@gitster.g> (raw)
In-Reply-To: <CAPUEspgrk3+FAo9Y6VWcYddh0o4xCkqmQ=GLap1XomcMmnFCuA@mail.gmail.com> (Carlo Arenas's message of "Thu, 21 Apr 2022 12:22:21 -0700")

Carlo Arenas <carenas@gmail.com> writes:

> On Thu, Apr 21, 2022 at 12:12 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> Carlo Arenas <carenas@gmail.com> writes:
>>
>> >> -       CC="${CC:-gcc}"
>> >> +       CC="${CC_PACKAGE:-${CC:-gcc}}"
>> > ...
> Wondering if something more explicit might be easier to understand anyway like :
>
>   if test -n "$CC_PACKAGE"
>   then
>      CC="$CC_PACKAGE"
>   fi
>
> Carlo

The parameter substitution is commonly used part of the shell
language, and even if developers, when starting to work on parts of
the system that are written in shell, are initially unfamiliar with
such language constructs, nobody will stay a newbie forever.  

To them, idioms like ${A:-${B:-C}} would quickly become as explicit
as a long-form written as if/then/elif/fi.  Surely it takes practice
to be familiar with the idiom, but idioms help those who know them
to be more efficient and effetive, so, no, I do not think it is a
good idea to aim for "easier to understand by newbies".

Thanks.





  reply	other threads:[~2022-04-21 19:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 13:03 [PATCH] CI: select CC based on CC_PACKAGE (again) Ævar Arnfjörð Bjarmason
2022-04-21 16:26 ` Phillip Wood
2022-04-21 17:48 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2022-04-21 19:05   ` Carlo Arenas
2022-04-21 19:11     ` Junio C Hamano
2022-04-21 19:22       ` Carlo Arenas
2022-04-21 19:47         ` Junio C Hamano [this message]
2022-04-21 19:08   ` Junio C Hamano
2022-04-21 19:13     ` Ævar Arnfjörð Bjarmason
2022-04-21 19:51       ` Junio C Hamano
2022-04-21 19:52         ` Ævar Arnfjörð Bjarmason
2022-04-21 19:55         ` Junio C Hamano
2022-04-22  9:20   ` [PATCH v3] " Ævar Arnfjörð Bjarmason
2022-04-22  9:25     ` Phillip Wood
2022-04-22 11:43       ` Ævar Arnfjörð Bjarmason
2022-04-22 18:27     ` Junio C Hamano
2022-04-22 22:40     ` Junio C Hamano
2022-04-22 22:46       ` Ævar Arnfjörð Bjarmason

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=xmqqr15qgqw1.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@talktalk.net \
    --cc=sunshine@sunshineco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).