git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 3/3] t: drop debug `cat` calls
Date: Mon, 24 Feb 2020 21:24:32 +0100	[thread overview]
Message-ID: <CAN0heSo8RSyvTqTtDLcnBsvMJ-DLL_B-sKRZDNUZBhZ1yX=bmQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqlforpyqe.fsf@gitster-ct.c.googlers.com>

On Mon, 24 Feb 2020 at 20:33, Junio C Hamano <gitster@pobox.com> wrote:
>
> Martin Ågren <martin.agren@gmail.com> writes:
>
> >       git fsck 2>out &&
> > -     cat out &&
> >       ! grep "commit $new" out
> >  '
>
> This one on the other hand *DOES* rely on 'out' being created; we do
> not want to take the failing 'grep' as a sign of success if it is
> because 'out' is missing.
>
> >       test_must_fail git update-index --nonsense 2>msg &&
> > -     cat msg &&
> >       test -s msg
> >  '
>
> This one does not.  "test -s msg" on non-existent msg will fail, so
> this is closer to category 2/3.
>
> So, I am OK to have two patches that catch two classes, but the
> division between 2/3 and 3/3 in this series does not look the right
> one.

Heh. You don't want to know how long I waffled on whether to split the
one hunk out to 2/3 and make the rest 3/3 vs. having a slightly larger
2/2.

For the first patch 1/3, if we lose the cat entirely, we risk bugs in
*git* being hidden. For the hunk in patch 2/3, I first thought it was in
the same category, before I realized that kwdelfile.c disappearing would
be a bug in *p4* as opposed to *git p4*. Since we're not in the business
of testing/verifying other people's software, we can afford to drop that
call entirely. At one point, I had this in the commit message, but in
the end I figured one reason for the removal was enough and just kept
the "we'll soon grep" argument.

I realize now that the line between 2/3 and 3/3 is blurry.

FWIW, for patch 3/3 my reasoning was that for the similar concern about
the file not existing, we'd depend on the shell messing up the
redirection quite badly and not creating a file at all, yet continuing
with the && cascade. Which seemed like a pretty crazy bug. And again,
that shouldn't be our worry. (I see now that there's a case in 3/3 where
a buggy test_cmp could delete "actual" and we'd fail to notice after
this commit. That probably also sorts under pathological bugs...)

> I am also OK to have a single patch with updated log message, saying
> "removal of 'cat <file>' may miss a failure mode that <file> did not
> get created, which would have been caught as a test failure in the
> original, but the <file>s used by cats removed in this patch are
> either impossible to be missing (because a preceding step in the
> test created it, or the &&-cascade would have failed if it failed to
> create the file), or followed by another step in the test that would
> fail if the file is missing (e.g. running grep on the file), so it is
> safe to drop these cats", or something like that.

Let me re-roll with 1/2 (=1/3) and 2/2 (=1/3+2/3).

Thanks for a review.

Martin

  reply	other threads:[~2020-02-24 20:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-23  8:48 [PATCH 1/3] t4117: check for files using `test_path_is_file` Martin Ågren
2020-02-23  8:48 ` [PATCH 2/3] t9810: drop debug `cat` call Martin Ågren
2020-02-24 19:18   ` Junio C Hamano
2020-02-23  8:48 ` [PATCH 3/3] t: drop debug `cat` calls Martin Ågren
2020-02-24 19:32   ` Junio C Hamano
2020-02-24 20:24     ` Martin Ågren [this message]
2020-02-24 20:49       ` Junio C Hamano
2020-02-23 21:46 ` [PATCH 1/3] t4117: check for files using `test_path_is_file` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN0heSo8RSyvTqTtDLcnBsvMJ-DLL_B-sKRZDNUZBhZ1yX=bmQ@mail.gmail.com' \
    --to=martin.agren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).