From: Eric Sunshine Date: Sun, 14 Mar 2021 01:10:35 GMT Subject: Re: [PATCH v5 6/6] doc/git-commit: add documentation for fixup=[amend|reword] options Message-ID: In-Reply-To: <20210313134012.20658-7-charvi077@gmail.com> On Sat, Mar 13, 2021 at 8:43 AM Charvi Mendiratta wrote: > Helped-by: Junio C Hamano > Signed-off-by: Eric Sunshine > Signed-off-by: Charvi Mendiratta 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. > diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt > @@ -86,11 +86,44 @@ OPTIONS > +--fixup=[(amend|reword):]:: > + Create a new commit which "fixes up" `` when applied with > + `git rebase --autosquash`. Plain `--fixup=` creates a > + "fixup!" commit which changes the content of `` but leaves > + its log message untouched. `--fixup=amend:` is similar but > + creates an "amend!" commit which also replaces the log message of > + `` with the log message of the "amend!" commit. > + `--fixup=reword:` creates an "amend!" commit which > + replaces the log message of `` with its own log message > + but makes no changes to the content of ``. > ++ > +The commit created by plain `--fixup=` has a subject > +composed of "fixup!" followed by the subject line from , > +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 `` by > +`git rebase --autosquash`. > ++ > +The commit created by `--fixup=amend:` is similar but its > +subject is instead prefixed with "amend!". The log message of > + 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 ``, the > +log message of `` 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:` is shorthand for `--fixup=amend: > +--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 `` > +without making any other changes. > ++ > +Neither "fixup!" nor "amend!" commits change authorship of > +`` 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.