From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Branchaud Subject: [PATCHv5] Teach rebase the --no-ff option. Date: Wed, 24 Mar 2010 16:34:04 -0400 Message-ID: <1269462844-13468-1-git-send-email-marcnarc@xiplink.com> References: <7vaatxskwc.fsf@alter.siamese.dyndns.org> Cc: Johannes Sixt , Jonathan Nieder , Junio C Hamano , Marc Branchaud To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Mar 24 21:34:16 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NuXHJ-0006oM-UZ for gcvg-git-2@lo.gmane.org; Wed, 24 Mar 2010 21:34:14 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516Ab0CXUeG (ORCPT ); Wed, 24 Mar 2010 16:34:06 -0400 Received: from 208-85-112-101.zerofail.com ([208.85.112.101]:59941 "EHLO farnsworth.xiplink.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932366Ab0CXUeE (ORCPT ); Wed, 24 Mar 2010 16:34:04 -0400 Received: from rincewind (rincewind.xiplink.com [192.168.1.136]) by farnsworth.xiplink.com (8.14.2/8.14.2/Debian-2build1) with ESMTP id o2OKVOGP013511; Wed, 24 Mar 2010 16:31:25 -0400 Received: by rincewind (Postfix, from userid 1000) id A1A983366A8; Wed, 24 Mar 2010 16:34:12 -0400 (EDT) X-Mailer: git-send-email 1.7.0.3.1.g7f7ff In-Reply-To: <7vaatxskwc.fsf@alter.siamese.dyndns.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: For git-rebase.sh, --no-ff is a synonym for --force-rebase. For git-rebase--interactive.sh, --no-ff cherry-picks all the commits in the rebased branch, instead of fast-forwarding over any unchanged commits. --no-ff offers an alternative way to deal with reverted merges. Instead of "reverting the revert" you can use "rebase --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. Signed-off-by: Marc Branchaud --- Now also makes git-rebase.sh treat --no-ff as a synonym for -f. I think I got the man page right... Also rewrote the addendum to revert-a-faulty-merge.txt to (hopefully) reflect Junio's comments. I agree about not teaching -f to rebase--interative. I was only mildly for it to begin with. It also occurred to me that we don't want users to think that "rebase -i" treats -f the same way as it does --no-ff, but making rebase--interactive silently accept -f might encourage that mistake. M. Documentation/git-rebase.txt | 23 ++++++- Documentation/howto/revert-a-faulty-merge.txt | 90 +++++++++++++++++++++++++ git-rebase--interactive.sh | 9 ++- git-rebase.sh | 4 +- t/t3404-rebase-interactive.sh | 36 +++++++++- 5 files changed, 152 insertions(+), 10 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 823f2a4..0d07b1b 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -274,9 +274,16 @@ 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. + Incompatible with the --interactive option. ++ +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 "revert +the reversion" (see the +link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details). --ignore-whitespace:: --whitespace=