Re: [PATCH v13 7/8] history: create squashed commits without editing
Junio C Hamano <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
Junio C Hamano <[email protected]> writes: > "Harald Nordgren via GitGitGadget" <[email protected]> writes: > >> +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 <[email protected]>" --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. In the meantime, I've queued the following on top of the series before rebuilding 'seen'. diff --git a/t/t3455-history-squash.sh b/t/t3455-history-squash.sh index 591463cb86..d21e9d9fc4 100755 --- a/t/t3455-history-squash.sh +++ b/t/t3455-history-squash.sh @@ -309,7 +309,7 @@ test_expect_success '--no-edit uses last "amend!" message without an editor' ' test_commit WIP && cat >msg <<-EOF && - amend! $(git rev-parse HEAD^ | tr a-f A-F) + amend! $(git rev-parse --short HEAD^) The third reword -- 2.55.0-758-g31b934252d