public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: Johannes Sixt <j.sixt@viscovery•net>
Cc: Kacper Kornet <draenog@pld-linux•org>,
	Junio C Hamano <gitster@pobox•com>,
	git@vger•kernel.org
Subject: Re: [PATCH] t1507: change quoting in test_did_you_mean to a more general one
Date: Fri, 06 May 2011 13:10:41 +0200	[thread overview]
Message-ID: <4DC3D731.3070503@drmicha.warpmail.net> (raw)
In-Reply-To: <4DC3CBEF.6080303@viscovery.net>

Johannes Sixt venit, vidit, dixit 06.05.2011 12:22:
> Am 5/6/2011 9:43, schrieb Michael J Gruber:
>> Junio C Hamano venit, vidit, dixit 05.05.2011 22:02:
>>> Kacper Kornet <draenog@pld-linux•org> writes:
>>>> -	printf "fatal: Path '$2$3' $4, but not ${5:-'$3'}.\n" >expected &&
>>>> -	printf "Did you mean '$1:$2$3'${2:+ aka '$1:./$3'}?\n" >>expected &&
>>>> +	printf "fatal: Path '$2$3' $4, but not ${5:-\'$3\'}.\n" >expected &&
>>>> +	printf "Did you mean '$1:$2$3'${2:+ aka \'$1:./$3\'}?\n" >>expected &&
>> Other than that, I have no objections if this patch makes more shells
>> happy and no happy ones unhappy.
>>
>> Is your ksh OK with all other tests?
> 
> Note that:
> 
> - With the proposed change, bash now prints the backslashes.
> 
> - The printfs should be echos, really.

I thought printfs can be relied upon better than echos (in terms of line
endings)?

> - The behavior of quoting at the right of :- when the ${...:-...} exansion
> appears in double-quotes was debated recently at length at the Austin
> group (which revises the POSIX standard). You better move the expansions
> to assignments of temporary variables, where you don't need the
> surrounding double-quotes:
> 
> 	butnot=${5:-\'$3\'} aka=${2:+ aka \'$1:./$3\'}
> 
> Here, the backslash unambiguously quotes the next character.
> 
> -- Hannes

Whatever makes most shells happy, as long as that includes current bash...

Michael

  reply	other threads:[~2011-05-06 11:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 19:10 [PATCH] t1507: change quoting in test_did_you_mean to a more general one Kacper Kornet
2011-05-05 20:02 ` Junio C Hamano
2011-05-06  7:43   ` Michael J Gruber
2011-05-06  8:51     ` Kacper Kornet
2011-05-06  9:14       ` Michael J Gruber
2011-05-06 10:22     ` Johannes Sixt
2011-05-06 11:10       ` Michael J Gruber [this message]
2011-05-06 14:23       ` Junio C Hamano
2011-05-09  4:40       ` Junio C Hamano
2011-05-09  6:39         ` Johannes Sixt
2011-05-09 16:20           ` Junio C Hamano
2011-05-06  8:39   ` Kacper Kornet

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=4DC3D731.3070503@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=draenog@pld-linux$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=j.sixt@viscovery$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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