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 <andy.koppe@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Andy Koppe committed
Nov 14, 2023 at 21:43 UTC
cb00f524df206f64174840b3f85eb39289e5a038
1 file changed
+20
-14
Documentation/git-rebase.txt
+20
-14
@@ -589,21 +589,27 @@ See also INCOMPATIBLE OPTIONS below.
589
590
--autosquash::
591
--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.
599
+
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.
613
+
614
See also INCOMPATIBLE OPTIONS below.
615