public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Ju <eric.peijian@gmail.com>
Cc: git@vger.kernel.org,  ps@pks.im,  jltobler@gmail.com,
	ericju711@gmail.com,  Karthik Nayak <karthik.188@gmail.com>
Subject: Re: [PATCH v2 1/1] refs: add 'preparing' phase to the reference-transaction hook
Date: Mon, 16 Mar 2026 09:24:56 -0700	[thread overview]
Message-ID: <xmqqv7evpwrr.fsf@gitster.g> (raw)
In-Reply-To: <20260316045102.70551-2-eric.peijian@gmail.com> (Eric Ju's message of "Mon, 16 Mar 2026 00:51:02 -0400")

Eric Ju <eric.peijian@gmail.com> writes:

> +	/* Preparing checks before locking references */
> +	ret = run_transaction_hook(transaction, "preparing");
> +	if (ret) {
> +		ref_transaction_abort(transaction, err);
> +		die(_("ref updates aborted by the reference-transaction hook at its %s state"), "preparing");
> +	}

On end-user's terminal, the above should look like

fatal: ref updates aborted by the reference-transaction hook at its parparing state

consuming more than 80 columns and having the varying part of the
message at the very end.  Can we shorten this and highlight the more
important bits?  Here is my attempt

		die(_("in '%s' phase, update aborted by the reference-transaction hook"),
			"preparing");

Enclosing the phase name in 'quotes' and moving it near the
beginning are both my attempt to make it stand out more.

Another thing you may want to consider is to extract the message to
a separate constant, i.e.,

	const char *abort_by_ref_transaction_hook[] =
	N_("in '%s' phase, update aborted by the reference-transaction hook");

and reuse at two places, perhaps?

		die(_(abort_by_ref_transaction_hook), "preparing");


  reply	other threads:[~2026-03-16 16:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 19:35 [PATCH 0/1] Add "preparing" phase to reference-transaction hook eric.peijian
2026-03-13 19:35 ` [PATCH 1/1] Add preparing state " eric.peijian
2026-03-13 21:20   ` Junio C Hamano
2026-03-16  3:09     ` Peijian Ju
2026-03-13 23:05   ` Justin Tobler
2026-03-13 23:09     ` Junio C Hamano
2026-03-16  3:09       ` Peijian Ju
2026-03-16  4:51 ` [PATCH v2 0/1] refs: add 'preparing' phase to the " Eric Ju
2026-03-16  4:51   ` [PATCH v2 1/1] " Eric Ju
2026-03-16 16:24     ` Junio C Hamano [this message]
2026-03-16 23:08       ` Peijian Ju
2026-03-16  7:03   ` [PATCH v2 0/1] " Patrick Steinhardt
2026-03-16 23:08     ` Peijian Ju
2026-03-17  2:36 ` [PATCH v3 " Eric Ju
2026-03-17  2:36   ` [PATCH v3 1/1] " Eric Ju

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=xmqqv7evpwrr.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=eric.peijian@gmail.com \
    --cc=ericju711@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@gmail.com \
    --cc=ps@pks.im \
    /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