git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Jeff King <peff@peff.net>
Subject: Re: [PATCH v2] builtins + test helpers: use return instead of exit() in cmd_*
Date: Wed, 09 Jun 2021 12:38:11 +0900	[thread overview]
Message-ID: <xmqqy2bjlnbw.fsf@gitster.g> (raw)
In-Reply-To: <87im2n3gje.fsf@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Wed, 09 Jun 2021 03:54:22 +0200")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> So it's really the opposite of what you're saying. If you have cleanups
> that are truly important, i.e. so important that you'd like to notify
> the user with a non-zero exit code if they fail, you *don't* want them
> in an atexit handler. That won't work.

Ah, OK.  What I had in mind was things like removing the directory
"clone" attempted to create and populate, removing temporary files,
etc.  when a function that is not marked as NORETURN calls die(), by
the atexit handler.  But you're right.  We leave a final clean-up
for normal returns (i.e. when cmd_foo() intends to return or exit
with 0) to be done to the caller that is git.::run_builtin().

Thanks.

      reply	other threads:[~2021-06-09  3:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 11:12 [PATCH] builtins + test helpers: use return instead of exit() in cmd_* Ævar Arnfjörð Bjarmason
2021-06-07 17:02 ` Felipe Contreras
2021-06-08  6:49 ` Jeff King
2021-06-08 10:53   ` Ævar Arnfjörð Bjarmason
2021-06-10 13:16   ` Phillip Wood
2021-06-10 13:19     ` Ævar Arnfjörð Bjarmason
2021-06-08 10:48 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2021-06-08 23:55   ` Junio C Hamano
2021-06-09  1:54     ` Ævar Arnfjörð Bjarmason
2021-06-09  3:38       ` Junio C Hamano [this message]

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=xmqqy2bjlnbw.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).