Re: [PATCH v6 3/6] set-head: better output for --auto
- From
Bence Ferdinandy <bence@ferdinandy.com>
- Date
- Oct 12, 2024, 22:29 UTC
- Message-ID
- <D4U6L3C2GHZG.2SN8P0C7ZH33M@ferdinandy.com>
- In-Reply-To
- <CAOLa=ZQY_a_dEZQ2EcLVfE_5Kjy7b2R3OFbQHQbkzH0o9-q1JA@mail.gmail.com>
On Fri Oct 11, 2024 at 22:43, karthik nayak <karthik.188@gmail.com> wrote:
Show 23 quoted lines
> "Bence Ferdinandy" <bence@ferdinandy.com> writes:
>
> [snip]
>
>>>
>>> > + git remote set-head --auto origin >output &&
>>> > + echo "'\''origin/HEAD'\'' is now created and points to '\''main'\''" >expect &&
>>>
>>> Nit: might be cleaner to use `${SQ}` here and below
>> You mean something like this?
>>
>> git remote set-head --auto origin >output &&
>> HEAD="'\''origin/HEAD'\''" &&
>> echo "${HEAD} is now created and points to '\''main'\''" >expect &&
>>
>> I tried a few variations and this is what I could get working, but I may be
>> simply missing something with the backtick.
>
> I mean simply this
>
> git remote set-head --auto origin >output &&
> echo "${SQ}origin/HEAD${SQ} is now created and points to
> ${SQ}main${SQ}" >expect &&Ah, I see in other tests this is used, but not in this particular test file. It's a bit hard to decide which is more cryptic, but ${SQ} is nicer on the eyes. On the other hand I would either switch the entire file in a separate patch or leave in the '\'' here as well. Or I guess one could go through the entire test base and switch everything to either one or the other for consistency.