From: Justin Tobler <jltobler@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Phillip Wood <phillip.wood123@gmail.com>,
Pablo Sabater <pabloosabaterr@gmail.com>,
git@vger.kernel.org, cat@malon.dev, ps@pks.im,
kaartic.sivaraam@gmail.com, ben.knoble@gmail.com
Subject: Re: [PATCH RFC v2 2/2] builtin/history: abort reword on same message
Date: Tue, 9 Jun 2026 15:14:24 -0500 [thread overview]
Message-ID: <aihwS9aQ1b_8q_5u@denethor> (raw)
In-Reply-To: <xmqq5x3r1ph0.fsf@gitster.g>
On 26/06/09 12:30PM, Junio C Hamano wrote:
> Justin Tobler <jltobler@gmail.com> writes:
>
> > I can see a situation where a user performs:
> >
> > git history reword abcd1234
> >
> > with the intention to modify a commit message, but then for some reason
> > changes their mind and doesn't want history to change. Maybe the wrong
> > commit was referenced, or they decide the current message is actually
> > fine. From my understanding, there isn't a great way to abort rewording
> > a commit during editing and thus the user would have to reset history
> > afterwards if they care enough to go back to the previous point.
> >
> > So I do see some value in a mechanism to abort rewriting a commit
> > message.
>
> I think we are saying the same thing in different ways. I want to
> see that command "succeed" either case (normally we create a new
> commit object because we record an updated committer timestamp, but
> if there is no need to create a new commit object only to record an
> updated committer timestamp, we may choose not to and leave the
> history intact) and I do not want it to *abort*.
>
> The mechanism to do so may be exactly the same, i.e., accept an
> updated log message, then try to "hash-object" (without -w) the
> commit object with everything, except for the updated commit log
> message, taken from the original commit, plus the updated log
> message. And if the resulting hash is the same as the original, do
> not do anything further and return happily. Aborting sounds more
> like complaining loudly "baa, you asked me to reword but you gave me
> the same message? is anything wrong with you?" with non-zero exit
> status, which I think the user does not deserve in such a case.
Yes, I completely agree. If the user doesn't update the commit message,
for whatever reason, that should still be considered a success since it
follows the user's intent. I don't think it makes sense to exit with a
non-zero code in such cases. I would also question if we should print
any message/note to the user at all for the same reasons.
-Justin
prev parent reply other threads:[~2026-06-09 20:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-07 20:07 [PATCH RFC 0/2] builtin/history: change git history reword behavior and feedback Pablo Sabater
2026-06-07 20:07 ` [PATCH RFC 1/2] builtin/history: abort reword on unchanged message Pablo Sabater
2026-06-08 9:30 ` Patrick Steinhardt
2026-06-08 10:52 ` Pablo Sabater
2026-06-08 12:16 ` Junio C Hamano
2026-06-08 16:44 ` Ben Knoble
2026-06-09 10:03 ` Pablo Sabater
2026-06-09 10:14 ` Pablo Sabater
2026-06-09 10:30 ` Kristoffer Haugsbakk
2026-06-09 13:21 ` Junio C Hamano
2026-06-09 15:51 ` Pablo Sabater
2026-06-08 16:37 ` Ben Knoble
2026-06-09 9:59 ` Pablo Sabater
2026-06-07 20:07 ` [PATCH RFC 2/2] builtin/history: print feedback after successful reword Pablo Sabater
2026-06-08 9:30 ` Patrick Steinhardt
2026-06-08 10:45 ` Pablo Sabater
2026-06-08 12:16 ` Junio C Hamano
2026-06-08 13:23 ` Pablo Sabater
2026-06-08 16:47 ` Ben Knoble
2026-06-09 10:42 ` [PATCH RFC v2 0/2] builtin/history: abort reword on same message Pablo Sabater
2026-06-09 10:42 ` [PATCH RFC v2 1/2] builtin/history: refactor function signature Pablo Sabater
2026-06-09 10:42 ` [PATCH RFC v2 2/2] builtin/history: abort reword on same message Pablo Sabater
2026-06-09 13:25 ` Phillip Wood
2026-06-09 16:20 ` Junio C Hamano
2026-06-09 17:12 ` Pablo Sabater
2026-06-09 19:17 ` Junio C Hamano
2026-06-09 18:02 ` Justin Tobler
2026-06-09 19:30 ` Junio C Hamano
2026-06-09 20:14 ` Justin Tobler [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aihwS9aQ1b_8q_5u@denethor \
--to=jltobler@gmail.com \
--cc=ben.knoble@gmail.com \
--cc=cat@malon.dev \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kaartic.sivaraam@gmail.com \
--cc=pabloosabaterr@gmail.com \
--cc=phillip.wood123@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