From: Junio C Hamano Date: Mon, 30 Sep 2019 04:19:31 +0000 (+0900) Subject: Merge branch 'dl/rebase-i-keep-base' X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/640f9cd5994ed2061405aa94972b1746bb0c393e?ds=inline;hp=-c Merge branch 'dl/rebase-i-keep-base' "git rebase --keep-base " tries to find the original base of the topic being rebased and rebase on top of that same base, which is useful when running the "git rebase -i" (and its limited variant "git rebase -x"). The command also has learned to fast-forward in more cases where it can instead of replaying to recreate identical commits. * dl/rebase-i-keep-base: rebase: teach rebase --keep-base rebase tests: test linear branch topology rebase: fast-forward --fork-point in more cases rebase: fast-forward --onto in more cases rebase: refactor can_fast_forward into goto tower t3432: test for --no-ff's interaction with fast-forward t3432: distinguish "noop-same" v.s. "work-same" in "same head" tests t3432: test rebase fast-forward behavior t3431: add rebase --fork-point tests --- 640f9cd5994ed2061405aa94972b1746bb0c393e diff --combined Documentation/git-rebase.txt index 7ecf766077,3146c1592d..639a4179d1 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@@ -8,8 -8,8 +8,8 @@@ git-rebase - Reapply commits on top of SYNOPSIS -------- [verse] - 'git rebase' [-i | --interactive] [] [--exec ] [--onto ] - [ []] + 'git rebase' [-i | --interactive] [] [--exec ] + [--onto | --keep-base] [ []] 'git rebase' [-i | --interactive] [] [--exec ] [--onto ] --root [] 'git rebase' (--continue | --skip | --abort | --quit | --edit-todo | --show-current-patch) @@@ -217,6 -217,24 +217,24 @@@ As a special case, you may use "A\...B merge base of A and B if there is exactly one merge base. You can leave out at most one of A and B, in which case it defaults to HEAD. + --keep-base:: + Set the starting point at which to create the new commits to the + merge base of . Running + 'git rebase --keep-base ' is equivalent to + running 'git rebase --onto ... '. + + + This option is useful in the case where one is developing a feature on + top of an upstream branch. While the feature is being worked on, the + upstream branch may advance and it may not be the best idea to keep + rebasing on top of the upstream but to keep the base commit as-is. + + + Although both this option and --fork-point find the merge base between + and , this option uses the merge base as the _starting + point_ on which new commits will be created, whereas --fork-point uses + the merge base to determine the _set of commits_ which will be rebased. + + + See also INCOMPATIBLE OPTIONS below. + :: Upstream branch to compare against. May be any valid commit, not just an existing branch name. Defaults to the configured @@@ -369,6 -387,10 +387,10 @@@ ends up being empty, the wil + If either or --root is given on the command line, then the default is `--no-fork-point`, otherwise the default is `--fork-point`. + + + If your branch was based on but was rewound and + your branch contains commits which were dropped, this option can be used + with `--keep-base` in order to drop those commits from your branch. --ignore-whitespace:: --whitespace=