public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
To: Alexey Shumkin <alex.crezoff@gmail•com>
Cc: Junio C Hamano <gitster@pobox•com>,
	GIT Mailing-list <git@vger•kernel.org>
Subject: Re: [PATCH] t6006-*.sh: Fix truncation tests
Date: Tue, 20 May 2014 17:43:31 +0100	[thread overview]
Message-ID: <537B8633.602@ramsay1.demon.co.uk> (raw)
In-Reply-To: <20140520160213.GA2947@ashu.dyn1.rarus.ru>

On 20/05/14 17:02, Alexey Shumkin wrote:
> On Tue, May 20, 2014 at 04:01:22PM +0100, Ramsay Jones wrote:
>> On 20/05/14 15:19, Alexey Shumkin wrote:
>>> On Tue, May 20, 2014 at 02:54:20PM +0100, Ramsay Jones wrote:
>>>>
>>>> Signed-off-by: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
>>>> ---
>>>>
>>>> Hi Alexey,
>>>>
>>>> If you need to re-roll your 'as/pretty-truncate' branch, could
>>>> you please squash the relevant parts of this patch into the
>>>> corresponding patches of your patch series. (ie this is a patch
>>>> against the head of the current pu branch ...).
>>>>
>>>> Without this patch I get:
>>>>
>>>>   $ ./t6006-rev-list-format.sh
>>>>   ok 1 - setup
>>>>   ok 2 - format percent
>>>>   ok 3 - format hash
>>>>   ok 4 - format tree
>>>>   ok 5 - format parents
>>>>   ok 6 - format author
>>>>   ok 7 - format committer
>>>>   ok 8 - format encoding
>>>>   ok 9 - format subject
>>>>   ./t6006-rev-list-format.sh: 152: ./t6006-rev-list-format.sh: Syntax error: "(" unexpected
>>>>   FATAL: Unexpected exit with code 2
>>>>   $ 
>>> Ooops, my fault.
>>>>
>>>> (if you have bash as /bin/sh you get different but related errors).
>>>> The additional quoting suppresses the 'command redirection' errors, etc...
>>> It's strange but I do have Bash as /bin/sh and unfortunately I have no
>>> this error
>>
>> Hmm, I see this:
>>
>>   $ bash t6006-rev-list-format.sh -i
> AFAIK, this is not "running Bash as /bin/sh" :)
> Maybe I'm wrong but Bash as /bin/sh is:
>   $ ls -l /bin/sh
>   lrwxrwxrwx 1 root root 4 May 12 18:35 /bin/sh -> bash

Ah yes, I keep forgetting that bash behaves differently when invoked as 'sh'.
(i.e. it enters 'posix mode' in this case).

Indeed, this is (roughly) equivalent to:

  $ bash --posix t6006-rev-list-format.sh
  ok 1 - setup
  ok 2 - format percent
  ok 3 - format hash
  ...
  ok 52 - oneline with empty message
  ok 53 - single-character name is parsed correctly
  # passed all 53 test(s)
  1..53
  $ 

... which works.

Thanks again.

ATB
Ramsay Jones

  reply	other threads:[~2014-05-20 16:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 13:54 [PATCH] t6006-*.sh: Fix truncation tests Ramsay Jones
2014-05-20 14:19 ` Alexey Shumkin
2014-05-20 14:34   ` Alexey Shumkin
2014-05-20 15:01   ` Ramsay Jones
2014-05-20 16:02     ` Alexey Shumkin
2014-05-20 16:43       ` Ramsay Jones [this message]
2014-05-20 17:10   ` Junio C Hamano
2014-05-21  4:11     ` Alexey Shumkin
2014-05-20 14:48 ` [PATCH] t6006 (rev-list-format): quote format strings to avoid error on some shells Alexey Shumkin
2014-05-20 15:03   ` Ramsay Jones
2014-05-21 12:59   ` Alexey Shumkin

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=537B8633.602@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1$(echo .)demon.co.uk \
    --cc=alex.crezoff@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    /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