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]> |
"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. Thanks.