Skip to content

Commit cb00f52

Browse files
ak2gitster
authored andcommitted
rebase: rewrite --(no-)autosquash documentation
Rewrite the description of the rebase --(no-)autosquash options to try to make it a bit clearer. Don't use "the '...'" to refer to part of a commit message, mention how --interactive can be used to review the todo list, and add a bit more detail on commit --squash/amend. Signed-off-by: Andy Koppe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 297be59 commit cb00f52

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

Documentation/git-rebase.txt

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -589,21 +589,27 @@ See also INCOMPATIBLE OPTIONS below.
589589

590590
--autosquash::
591591
--no-autosquash::
592-
When the commit log message begins with "squash! ..." or "fixup! ..."
593-
or "amend! ...", and there is already a commit in the todo list that
594-
matches the same `...`, automatically modify the todo list of
595-
`rebase`, so that the commit marked for squashing comes right after
596-
the commit to be modified, and change the action of the moved commit
597-
from `pick` to `squash` or `fixup` or `fixup -C` respectively. A commit
598-
matches the `...` if the commit subject matches, or if the `...` refers
599-
to the commit's hash. As a fall-back, partial matches of the commit
600-
subject work, too. The recommended way to create fixup/amend/squash
601-
commits is by using the `--fixup`, `--fixup=amend:` or `--fixup=reword:`
602-
and `--squash` options respectively of linkgit:git-commit[1].
592+
Automatically squash commits with specially formatted messages into
593+
previous commits being rebased. If a commit message starts with
594+
"squash! ", "fixup! " or "amend! ", the remainder of the subject line
595+
is taken as a commit specifier, which matches a previous commit if it
596+
matches the subject line or the hash of that commit. If no commit
597+
matches fully, matches of the specifier with the start of commit
598+
subjects are considered.
603599
+
604-
If the `--autosquash` option is enabled by default using the
605-
configuration variable `rebase.autoSquash`, this option can be
606-
used to override and disable this setting.
600+
In the rebase todo list, the actions of squash, fixup and amend commits are
601+
changed from `pick` to `squash`, `fixup` or `fixup -C`, respectively, and they
602+
are moved right after the commit they modify. The `--interactive` option can
603+
be used to review and edit the todo list before proceeding.
604+
+
605+
The recommended way to create commits with squash markers is by using the
606+
`--squash`, `--fixup`, `--fixup=amend:` or `--fixup=reword:` options of
607+
linkgit:git-commit[1], which take the target commit as an argument and
608+
automatically fill in the subject line of the new commit from that.
609+
+
610+
Settting configuration variable `rebase.autoSquash` to true enables
611+
auto-squashing by default for interactive rebase. The `--no-autosquash`
612+
option can be used to override that setting.
607613
+
608614
See also INCOMPATIBLE OPTIONS below.
609615

0 commit comments

Comments
 (0)