git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
	Daniels Umanovskis <daniels@umanovskis.se>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH v5] branch: introduce --show-current display option
Date: Thu, 1 Nov 2018 18:01:20 -0400	[thread overview]
Message-ID: <20181101220119.GA26383@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqefcdfs1j.fsf@gitster-ct.c.googlers.com>

On Fri, Oct 26, 2018 at 09:52:24AM +0900, Junio C Hamano wrote:

> Eric Sunshine <sunshine@sunshineco.com> writes:
> 
> >> +       test_when_finished "git tag -d branch-and-tag-name" &&
> >> +       git tag branch-and-tag-name &&
> >
> > If git-tag crashes before actually creating the new tag, then "git tag
> > -d", passed to test_when_finished(), will error out too, which is
> > probably undesirable since "cleanup code" isn't expected to error out.
> 
> Ah, I somehow thought that clean-up actions set up via when_finished
> are allowed to fail without affecting the outcome, but apparently I
> was mistaken.

If a when_finished block fails, we consider that a test failure. But if
we failed to create the tag, the test is failing anyway. Do we actually
care at that point?

We would still want to make sure we run the rest of the cleanup, but
looking at the definition of test_when_finished(), I think we do.

> I haven't gone through the list of when_finished clean-up actions
> that do not end with "|| :"; I suspect some of them are simply being
> sloppy and would want to have "|| :", but what I want to find out
> out of such an audit is if there is a legitimate case where it helps
> to catch failures in the clean-up actions.  If there is none, then
> ...

I think in the success case it is legitimately helpful. If that "tag -d"
failed above (after the tag creation and the rest of the test
succeeded), it would certainly be unexpected and we would want to know
that it happened. So I think "|| :" in this case is not just
unnecessary, but actively bad.

-Peff

  reply	other threads:[~2018-11-01 22:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 19:04 [PATCH v5] branch: introduce --show-current display option Daniels Umanovskis
2018-10-25 19:30 ` Eric Sunshine
2018-10-26  0:52   ` Junio C Hamano
2018-11-01 22:01     ` Jeff King [this message]
2018-10-26  1:53   ` Junio C Hamano
2018-11-07 22:56 ` [PATCH] branch: make --show-current use already resolved HEAD Rafael Ascensão
2018-11-08  1:11   ` Junio C Hamano
2018-11-08  4:36     ` Rafael Ascensão

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=20181101220119.GA26383@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=daniels@umanovskis.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.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).