From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [Q] rebase -i: turn "pick" to "edit", make no change, what should happen?
Date: Thu, 16 May 2024 12:21:55 -0700 [thread overview]
Message-ID: <xmqqy189o94c.fsf@gitster.g> (raw)
What should happen when I turn "pick" to "edit" in a "rebase -i"
session, check what got checked out in the working tree, find it
satisfactory and decide not to make any change to the files, and say
"rebase --continue"?
The current implementation seems to just move to the next step,
without offering a chance to edit the log message. I do not know
offhand if this is something we changed recently, or if it has been
that way forever.
I personally found this a bit unintuitive, because in my metal
model, "reword" is a mere subset of "edit": the latter would give me
chances to change both the contents and the log, while the former
only would offer me a chance to change the log.
But the actual behaviour does not match that mental model. "edit"
is purely about editing the worktree files, and only if files (hence
the tree recorded) are modified, a chance to edit the log is offered
to adjust the message to what the new tree brings on top of the
parent commit.
Of course, we can work it around with "git rebase --edit-todo"
before saying "git rebase --continue". But the current behaviour
somehow feels optimized for a wrong case. Admittedly, it is logical
that it does not offer a chance to edit the log message if we did
not make any change to the working tree. After all, the reason why
it may become necessary to edit the log is because the user made
some changes to the tree in the first place. And by not opening the
editor, only to close it without making any change, the command is
saving the user some keystrokes.
But given that saying "edit" and not making any changes is a rare
case, it feels wrong thing to optimize for.
Anyway.
next reply other threads:[~2024-05-16 19:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 19:21 Junio C Hamano [this message]
2024-05-16 22:18 ` [Q] rebase -i: turn "pick" to "edit", make no change, what should happen? Sean Allred
2024-05-17 7:09 ` Junio C Hamano
2024-05-17 7:32 ` Patrick Steinhardt
2024-05-17 8:54 ` Dragan Simic
2024-05-17 13:52 ` Sean Allred
2024-05-17 15:17 ` Junio C Hamano
2024-05-17 12:42 ` Marc Branchaud
2024-05-17 17:04 ` Junio C Hamano
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=xmqqy189o94c.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).