git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] CI: select CC based on CC_PACKAGE (again)

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2022, 19:47 UTC
Message-ID
<xmqqr15qgqw1.fsf@gitster.g>
In-Reply-To
<CAPUEspgrk3+FAo9Y6VWcYddh0o4xCkqmQ=GLap1XomcMmnFCuA@mail.gmail.com>
Carlo Arenas <carenas@gmail.com> writes:
Show 15 quoted lines
> 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.
Previous: Carlo ArenasNext: Junio C Hamano
Message 7 of 18 in “CI: select CC based on CC_PACKAGE (again)”
  1. CI: select CC based on CC_PACKAGE (again)Ævar Arnfjörð Bjarmason, Apr 21, 2022
  2. Phillip WoodApr 21, 2022
  3. CI: select CC based on CC_PACKAGE (again)Ævar Arnfjörð Bjarmason, Apr 21, 2022
  4. Carlo ArenasApr 21, 2022
  5. Junio C HamanoApr 21, 2022
  6. Carlo ArenasApr 21, 2022
  7. Junio C HamanoApr 21, 2022
  8. Junio C HamanoApr 21, 2022
  9. Ævar Arnfjörð BjarmasonApr 21, 2022
  10. Junio C HamanoApr 21, 2022
  11. Ævar Arnfjörð BjarmasonApr 21, 2022
  12. Junio C HamanoApr 21, 2022
  13. CI: select CC based on CC_PACKAGE (again)Ævar Arnfjörð Bjarmason, Apr 22, 2022
  14. Phillip WoodApr 22, 2022
  15. Ævar Arnfjörð BjarmasonApr 22, 2022
  16. Junio C HamanoApr 22, 2022
  17. Junio C HamanoApr 22, 2022
  18. Ævar Arnfjörð BjarmasonApr 22, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.