Re: [PATCH v5 6/6] doc/git-commit: add documentation for fixup=[amend|reword] options
flat view
From: Eric Sunshine <hidden>
Date: 2021-03-14 01:27:23
On Sat, Mar 13, 2021 at 8:43 AM Charvi Mendiratta [off-list ref] wrote:
Helped-by: Junio C Hamano [off-list ref] Signed-off-by: Eric Sunshine <redacted> Signed-off-by: Charvi Mendiratta <redacted>
It may have been more accurate to retain the Helped-by: with my name while adding the Signed-off-by: (which I offered in case you incorporated my significant rewrites), rather than replacing the Helped-by: altogether. Not worth a re-roll, though.
quoted hunk ↗ jump to hunk
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt@@ -86,11 +86,44 @@ OPTIONS +--fixup=[(amend|reword):]<commit>:: + Create a new commit which "fixes up" `<commit>` when applied with + `git rebase --autosquash`. Plain `--fixup=<commit>` creates a + "fixup!" commit which changes the content of `<commit>` but leaves + its log message untouched. `--fixup=amend:<commit>` is similar but + creates an "amend!" commit which also replaces the log message of + `<commit>` with the log message of the "amend!" commit. + `--fixup=reword:<commit>` creates an "amend!" commit which + replaces the log message of `<commit>` with its own log message + but makes no changes to the content of `<commit>`. ++ +The commit created by plain `--fixup=<commit>` has a subject +composed of "fixup!" followed by the subject line from <commit>, +and is recognized specially by `git rebase --autosquash`. The `-m` +option may be used to supplement the log message of the created +commit, but the additional commentary will be thrown away once the +"fixup!" commit is squashed into `<commit>` by +`git rebase --autosquash`. ++ +The commit created by `--fixup=amend:<commit>` is similar but its +subject is instead prefixed with "amend!". The log message of +<commit> is copied into the log message of the "amend!" commit and +opened in an editor so it can be refined. When `git rebase +--autosquash` squashes the "amend!" commit into `<commit>`, the +log message of `<commit>` is replaced by the refined log message +from the "amend!" commit. It is an error for the "amend!" commit's +log message to be empty unless `--allow-empty-message` is +specified. ++ +`--fixup=reword:<commit>` is shorthand for `--fixup=amend:<commit> +--only`. It creates an "amend!" commit with only a log message +(ignoring any changes staged in the index). When squashed by `git +rebase --autosquash`, it replaces the log message of `<commit>` +without making any other changes. ++ +Neither "fixup!" nor "amend!" commits change authorship of +`<commit>` when applied by `git rebase --autosquash`. +See linkgit:git-rebase[1] for details.
I see that you took my entire rewrite verbatim. That's fine. My bias is probably showing, but I do now find this documentation patch easier to understand. Thanks.