From: Marc Branchaud Date: Wed, 24 Mar 2010 15:41:01 GMT Subject: [PATCH 2/2] Teach the --no-ff option to 'rebase -i'. Message-ID: <1269445261-2941-3-git-send-email-marcnarc@xiplink.com> In-Reply-To: <7vzl1yd5j4.fsf@alter.siamese.dyndns.org> This option tells git-rebase--interactive to cherry-pick all the commits in the rebased branch, instead of fast-forwarding over any unchanged commits. --no-ff offers an alterntive way to deal with reverted merges. Instead of "reverting the revert" you can use "rebase -i --no-ff" to recreate the branch with entirely new commits (they're new because at the very least the committer time is different). This obviates the need to revert the reversion, as you can re-merge the new topic branch directly. Added an addendum to revert-a-faulty-merge.txt describing the situation and how to use --no-ff to handle it. --force-rebase also provides this alternative with non-interactive rebase, so updated rebase's man page to mention it. Signed-off-by: Marc Branchaud --- Documentation/git-rebase.txt | 23 +++++++++- Documentation/howto/revert-a-faulty-merge.txt | 61 +++++++++++++++++++++++++ git-rebase--interactive.sh | 9 +++- t/t3404-rebase-interactive.sh | 36 +++++++++++++-- 4 files changed, 121 insertions(+), 8 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 823f2a4..ca06c55 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -274,9 +274,15 @@ which makes little sense. -f:: --force-rebase:: Force the rebase even if the current branch is a descendant - of the commit you are rebasing onto. Normally the command will + of the commit you are rebasing onto. Normally non-interactive rebase will exit with the message "Current branch is up to date" in such a situation. ++ +You may find this (or --no-ff with an interactive rebase) helpful after +reverting a topic branch merge, as this option recreates the topic branch with +fresh commits so it can be remerged successfully without needing to "reverting +the reversion" (as described in the +link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To]). --ignore-whitespace:: --whitespace=