Skip to content

Commit b8ad365

Browse files
newrengitster
authored andcommitted
rebase: fix docs about incompatibilities with --root
In commit 5dacd4a ("git-rebase.txt: document incompatible options", 2018-06-25), I added notes about incompatibilities between options for the apply and merge backends. Unfortunately, I inverted the condition when --root was incompatible with the apply backend. Fix the documentation, and add a testcase that verifies the documentation matches the code. While at it, the documentation for --root also tried to cover some of the backend differences between the apply and merge backends in relation to reapplying cherry picks. The information: * assumed that the apply backend was the default (it isn't anymore) * was written before --reapply-cherry-picks became an option * was written before the detailed information on backend differences All of these factors make the sentence under --root about reapplying cherry picks contradict information that is now available elsewhere in the manual, and the other references are correct. So just strike this sentence. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a66d8c commit b8ad365

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Documentation/git-rebase.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,7 @@ See also INCOMPATIBLE OPTIONS below.
574574
--root::
575575
Rebase all commits reachable from `<branch>`, instead of
576576
limiting them with an `<upstream>`. This allows you to rebase
577-
the root commit(s) on a branch. When used with `--onto`, it
578-
will skip changes already contained in `<newbase>` (instead of
579-
`<upstream>`) whereas without `--onto` it will operate on every
580-
change.
577+
the root commit(s) on a branch.
581578
+
582579
See also INCOMPATIBLE OPTIONS below.
583580

@@ -656,7 +653,7 @@ are incompatible with the following options:
656653
* --reapply-cherry-picks
657654
* --edit-todo
658655
* --update-refs
659-
* --root when used in combination with --onto
656+
* --root when used without --onto
660657

661658
In addition, the following pairs of options are incompatible:
662659

t/t3422-rebase-incompatible-options.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ test_rebase_am_only () {
6565
test_must_fail git rebase $opt --update-refs A
6666
"
6767

68+
test_expect_success "$opt incompatible with --root without --onto" "
69+
git checkout B^0 &&
70+
test_must_fail git rebase $opt --root A
71+
"
6872
}
6973

7074
# Check options which imply --apply

0 commit comments

Comments
 (0)