git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] - git rebase -i performs rebase when it shouldn't?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 10, 2010, 04:39 UTC
Message-ID
<7vsk73zzt1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100410042609.GA24295@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> So no, it's not a bug. Yes, it's a terrible interface. There is really
> no reason IMHO for rebase to take a "which branch to operate on"
> argument at all. It should just operate on HEAD, like merge does. If you
> want to merge on a different branch, you "git checkout" that branch
> first.

I guess it's my turn to say "sorry it was my fault made in pre-maintainer days around 59e6b23 ([PATCH] git-rebase-script: rebase local commits to new upstream head., 2005-06-25).

I used to religiously rebase slushy topics that are not in any stable integration branches (we used to have only 'master' and 'pu'), and

	git rebase master foo
        git rebase master bar
        git rebase master baz
was far easier to type than
	git checkout foo && git rebase master
	git checkout bar && git rebase master
	git checkout baz && git rebase master

when you have many topics. Especially because the exact keystroke sequences are:

	git rebase master foo ENTER
	^P (recall the last line) ^W (delete the last word) bar ENTER
	^P ^W baz ENTER
for the former.  Of course, I can do the same with the latter interface
	sh -c 'git checkout "$1" && git rebase master' - foo ENTER
	^P (recall the last line) ^W (delete the last word) bar ENTER
	^P ^W baz ENTER

so that is not a very good excuse, but at least now people know where it came from ;-)

Previous: Jeff KingNext: Jeff King
Message 3 of 19 in “[BUG] - git rebase -i performs rebase when it shouldn't?”
  1. Eugene SajineApr 9, 2010
  2. Jeff KingApr 10, 2010
  3. Junio C HamanoApr 10, 2010
  4. Jeff KingApr 10, 2010
  5. Johannes SixtApr 10, 2010
  6. Jeff KingApr 11, 2010
  7. Johannes SixtApr 11, 2010
  8. Jeff KingApr 12, 2010
  9. Michal VitecekApr 12, 2010
  10. Johannes SixtApr 12, 2010
  11. Eugene SajineApr 10, 2010
  12. Jeff KingApr 11, 2010
  13. Eugene SajineApr 11, 2010
  14. Eugene SajineApr 12, 2010
  15. Johannes SixtApr 12, 2010
  16. Eugene SajineApr 12, 2010
  17. Johannes SixtApr 12, 2010
  18. Eugene SajineApr 13, 2010
  19. Johannes SixtApr 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.