Skip to content

Commit 6d6b412

Browse files
committed
Merge branch 'en/rebase-root-and-fork-point-are-incompatible'
Incompatible options "--root" and "--fork-point" of "git rebase" have been marked and documented as being incompatible. * en/rebase-root-and-fork-point-are-incompatible: rebase: display an error if --root and --fork-point are both provided
2 parents aabf3ea + a35413c commit 6d6b412

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Documentation/git-rebase.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,14 @@ When --fork-point is active, 'fork_point' will be used instead of
449449
<branch>` command (see linkgit:git-merge-base[1]). If 'fork_point'
450450
ends up being empty, the <upstream> will be used as a fallback.
451451
+
452-
If either <upstream> or --root is given on the command line, then the
453-
default is `--no-fork-point`, otherwise the default is `--fork-point`.
452+
If <upstream> is given on the command line, then the default is
453+
`--no-fork-point`, otherwise the default is `--fork-point`.
454454
+
455455
If your branch was based on <upstream> but <upstream> was rewound and
456456
your branch contains commits which were dropped, this option can be used
457457
with `--keep-base` in order to drop those commits from your branch.
458+
+
459+
See also INCOMPATIBLE OPTIONS below.
458460

459461
--ignore-whitespace::
460462
--whitespace=<option>::
@@ -636,6 +638,7 @@ In addition, the following pairs of options are incompatible:
636638
* --preserve-merges and --empty=
637639
* --keep-base and --onto
638640
* --keep-base and --root
641+
* --fork-point and --root
639642

640643
BEHAVIORAL DIFFERENCES
641644
-----------------------

builtin/rebase.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
14811481
die(_("cannot combine '--keep-base' with '--root'"));
14821482
}
14831483

1484+
if (options.root && fork_point > 0)
1485+
die(_("cannot combine '--root' with '--fork-point'"));
1486+
14841487
if (action != ACTION_NONE && !in_progress)
14851488
die(_("No rebase in progress?"));
14861489
setenv(GIT_REFLOG_ACTION_ENVIRONMENT, "rebase", 0);

0 commit comments

Comments
 (0)