From: Junio C Hamano <gitster@pobox.com>
To: Robert Coup <robert.coup@koordinates.com>
Cc: git <git@vger.kernel.org>
Subject: Re: bug/defaults: COMMIT_EDITMSG not reused after a failed commit
Date: Wed, 24 Jul 2024 09:37:01 -0700 [thread overview]
Message-ID: <xmqq1q3iyceq.fsf@gitster.g> (raw)
In-Reply-To: <CAFLLRpJgpjJpNRC_UpZmUXF2626e0BiH8CkOkoMrX3zcrOp7YA@mail.gmail.com> (Robert Coup's message of "Wed, 24 Jul 2024 12:28:47 +0100")
Robert Coup <robert.coup@koordinates.com> writes:
> 1. delete COMMIT_EDITMSG on success
>
> 2. reopen COMMIT_EDITMSG on commit if it exists. Maybe logging something like
> "Restoring previous in-progress commit message..." might explain what's
> happening.
> 3. if COMMIT_EDITMSG doesn't exist, re-populate from the template before opening
> the editor. We could also do this for "parsed-as-empty" commit messages.
Unconditionally doing this change would be disruptive to workflows
of existing users. To them, Git left COMMIT_EDITMSG available even
after the commit to them almost forever, but suddenly it stops doing
so. Like "git cherry-pick|rebase|revert" that got stopped can be
restarted _with_ some state information with "--continue", offering
this as an optional feature might be a possibility, but I haven't
thought things through.
An obvious and a lot more lightweight first step is to make it clear
(perhaps in the error message after a failed commit---after all,
such a failure from "git commit" should be a rare event) where you
can resurrect the draft commit message from. That is independent
and orthogonal to the "let's reuse COMMIT_EDITMSG file" change.
A similar issue was reported a few years ago but without any
response or action.
https://lore.kernel.org/git/CAJ2_uEOk8xoLvK8B8PYc0_=kA8W_LqKwGyhKghemQDdRzA2nFA@mail.gmail.com/
Let's see if we find somebody interested in it this time.
Thanks.
next prev parent reply other threads:[~2024-07-24 16:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 11:28 bug/defaults: COMMIT_EDITMSG not reused after a failed commit Robert Coup
2024-07-24 16:37 ` Junio C Hamano [this message]
2024-07-24 16:53 ` Konstantin Ryabitsev
2024-07-24 21:08 ` Jeff King
2024-07-25 15:21 ` Junio C Hamano
2024-07-25 8:15 ` Robert Coup
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=xmqq1q3iyceq.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=robert.coup@koordinates.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.