git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] refs: add 'preparing' phase to the reference-transaction hook

From
Peijian Ju <eric.peijian@gmail.com>
Date
Mar 16, 2026, 23:08 UTC
Message-ID
<CAN2LT1AeEYbCFvhUSnWPvCUtahVQP_cG8edVhURHg2N3OgMuwQ@mail.gmail.com>
In-Reply-To
<xmqqv7evpwrr.fsf@gitster.g>
On Mon, Mar 16, 2026 at 12:24 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 34 quoted lines
>
> 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");
>
Thank you. Fixed in V3.
- Eric
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 11 of 15 in “Add "preparing" phase to reference-transaction hook”
  1. 0/1 Add "preparing" phase to reference-transaction hookeric.peijian@gmail.com, Mar 13, 2026
  2. 1/1 Add preparing state to reference-transaction hookeric.peijian@gmail.com, Mar 13, 2026
  3. Junio C HamanoMar 13, 2026
  4. Peijian JuMar 16, 2026
  5. Justin ToblerMar 13, 2026
  6. Junio C HamanoMar 13, 2026
  7. Peijian JuMar 16, 2026
  8. 0/1 refs: add 'preparing' phase to the reference-transaction hookEric Ju, Mar 16, 2026
  9. 1/1 refs: add 'preparing' phase to the reference-transaction hookEric Ju, Mar 16, 2026
  10. Junio C HamanoMar 16, 2026
  11. Peijian JuMar 16, 2026
  12. Patrick SteinhardtMar 16, 2026
  13. Peijian JuMar 16, 2026
  14. 0/1 refs: add 'preparing' phase to the reference-transaction hookEric Ju, Mar 17, 2026
  15. 1/1 refs: add 'preparing' phase to the reference-transaction hookEric Ju, Mar 17, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.