Re: [PATCH 1/4] builtin/history: perform revwalk checks before asking for user input
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 13, 2026, 05:51 UTC
- Message-ID
- <aY67ycgnisRjeguw@pks.im>
- In-Reply-To
- <xmqqcy29ohi5.fsf@gitster.g>
On Thu, Feb 12, 2026 at 12:04:50PM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > diff --git a/t/t3451-history-reword.sh b/t/t3451-history-reword.sh > > index 3594421b68..6775ed62f9 100755 > > --- a/t/t3451-history-reword.sh > > +++ b/t/t3451-history-reword.sh > > @@ -263,7 +263,7 @@ test_expect_success '--ref-action=head updates only HEAD' ' > > > > # When told to update HEAD, only, the command will refuse to > > # rewrite commits that are not an ancestor of HEAD. > > - test_must_fail git history reword --ref-action=head theirs 2>err && > > + test_must_fail git -c core.editor=false history reword --ref-action=head theirs 2>err && > > test_grep "rewritten commit must be an ancestor of HEAD" err && > > This ensures that the editor is never consulted? How? Running the > "false" editor would give us a different error, like "your editor > exited with non-zero status, telling us to abort" or something?
Yup, exactly that. We'd see "Aborting commit as launching the editor failed." instead of the above error message.
Patrick