From: Jonathan Nieder Date: Tue, 23 Mar 2010 19:16:03 GMT Subject: Re: [PATCH] Test that the 'rebase -i' "reword" command always cherry-picks a commit. Message-ID: <20100323191603.GB1382@progeny.tock> In-Reply-To: <4BA8D263.8040602@xiplink.com> Marc Branchaud wrote: > Junio C Hamano wrote: >> "rebase -i --no-ff" >> already exists, and is probably a more natural way to do this than saying >> "reword" but not rewording anything, no? >> >> I would actually say "rebase -f P" would be even easier and clearer, >> especially as... [...] > I was confused about the purpose of "rebase -f". Jonathan Nieder even > pointed me to it when I posted my original patch for "rebase -i --no-ff", but > the description in the man page threw me: > > Force the rebase even if the current branch is a descendant of > the commit you are rebasing onto. Normally the command will > exit with the message "Current branch is up to date" in such a > situation. > > I didn't realize that this is exactly the situation that "rebase -i" normally > deals with (-i basically implies -f), and that "rebase -f" would do exactly > what I wanted "rebase -i --no-ff" to do. Yes, sorry for not following up on that comment. The point is that rebase without --interactive never fast-forwards. So if you do not need to edit your branch interactively, it should work for your purpose. > But I think I see an approach that might make sense: > > - Teach "rebase -i" to recognize the -f parameter (instead of --no-ff). I like --no-ff better. :) > - Update rebase's man page to better explain -f. While at it, I should mention another documentation problem: rebase’s man page does not explain that rebase --interactive will fast-forward at the beginning of the series. It should say that rebase -i will do that and rebase without -i will not. I can prepare a patch to fix it this evening. > - Update revert-a-faulty-merge.txt to explain how to use "rebase [-i] -f". Sounds interesting. Simpler to use "rebase (-f | -i --no-ff)", I think. Or maybe rebase could learn a no-op --no-ff option to make it easier to switch between it and rebase -i, and this would become "rebase (-f | -i) --no-ff". Jonathan