Re: [PATCH v13 7/8] history: create squashed commits without editing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 13, 2026, 17:28 UTC
- Message-ID
- <xmqq4igyszeb.fsf@gitster.g>
- In-Reply-To
- <8b3551d0d4ecb360775ea29507ee262c7bf9cd42.1786088371.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 33 quoted lines
> +test_expect_success '--no-edit uses last "amend!" message without an editor' ' > + git reset --hard three && > + write_script editor <<-\EOF && > + exit 1 > + EOF > + test_set_editor "$(pwd)/editor" && > + echo fix >file && > + git commit --author="Fix Me <fix.me@example.com>" --fixup=HEAD -a && > + git commit --allow-empty -F - <<-EOF && > + amend! $(git rev-parse --short HEAD) > + > + The first reword > + > + More detail > + EOF > + > + git commit --allow-empty -F - <<-\EOF && > + amend! three > + > + The second reword > + > + Extra detail > + EOF > + > + test_commit WIP && > + > + cat >msg <<-EOF && > + amend! $(git rev-parse HEAD^ | tr a-f A-F) > + > + The third reword > + > + Excruciating detail > + EOF
Care to explain why you need to (1) eat the exit status of the 'git rev-parse' command and (2) munge the commit object name by piping it into "tr"?
When another in-flight topic is in effect, this test will break due to "amend!" followed by a string that is *not* an object name, as the other topic declares that uppercase letters are not valid in a hexadecimal string.
Thanks.