git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Armin Kunaschik <megabreit@googlemail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: t4151 missing quotes
Date: Mon, 9 May 2016 12:26:45 -0400	[thread overview]
Message-ID: <CAPig+cS9OeqGz9xM802pDR68tO7fLos3HKWezy8_y2gsyn_fAA@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cTbAA8xDWvCXbBF+HJpxONS38hcjAiNuocC+PUBro9ALg@mail.gmail.com>

On Mon, May 9, 2016 at 12:22 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Mon, May 9, 2016 at 12:09 PM, Armin Kunaschik
> <megabreit@googlemail.com> wrote:
>> *** t4151-am-abort.sh   Mon May  9 17:51:44 2016
>> --- t4151-am-abort.sh.orig      Fri Apr 29 23:37:00 2016
>> !       test 3 -eq "$(git ls-files -u | wc -l)" &&
>> !       test 3 -eq $(git ls-files -u | wc -l) &&
>
> Some comments:
>
> Quoting the output of 'wc -l' will break the tests on Mac OS X and BSD
> since the output contains leading whitespace which won't match the "3"
> on the other side of the '='.

This isn't quite accurate. Since the test is using '-eq' rather than
'=', the leading whitespace won't be a problem, but it can still be
problematic if you're somehow getting an empty result from the
pipeline:

    % test 3 -eq "$(echo)"
    -bash: test: : integer expression expected

> Your diff is backward, comparing 'current' against 'original', which
> makes it difficult to read. Reviewers on this list expect to see
> 'original' compared against 'current'.
>
> Use a unified format to make the diff easier to read; or just use
> git-diff or git-format patch, which is even simpler.
>
> It's not clear how the output of 'wc -l' could ever be the empty
> string. Perhaps git-ls-files is dying and causing the pipe to abort
> before 'wc -l' ever outputs anything? Without additional information
> about the problem you're experiencing, it's difficult to judge if this
> change is a good idea.

  reply	other threads:[~2016-05-09 16:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 16:09 t4151 missing quotes Armin Kunaschik
2016-05-09 16:22 ` Eric Sunshine
2016-05-09 16:26   ` Eric Sunshine [this message]
2016-05-09 16:35   ` Armin Kunaschik
2016-05-09 17:57     ` Eric Sunshine
2016-05-09 18:11       ` Armin Kunaschik
2016-05-09 18:56     ` Junio C Hamano
2016-05-09 19:19       ` Stefan Beller
2016-05-09 20:16       ` Eric Sunshine
2016-05-09 20:45         ` Junio C Hamano
2016-05-09 21:35           ` Eric Sunshine
2016-05-10 13:44             ` Armin Kunaschik
2016-05-10 13:48               ` Jeff King

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=CAPig+cS9OeqGz9xM802pDR68tO7fLos3HKWezy8_y2gsyn_fAA@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=megabreit@googlemail.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).