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

Re: Interactive rebase with pre-built script?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 11, 2012, 15:35 UTC
Message-ID
<7vliggk1xn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.2.00.1209110725130.8398@ds9.cixit.se>
Peter Krefting <peter@softwolves.pp.se> writes:
> I was thinking about using git cherry-pick with a list of commits,
> rebase is better at helping with conflicts and such.

Because the three-way merge done by rebase is exactly the same as cherry-pick, I do not think I understand the reasoning behind this statement at all. After the command gives you control back asking for your help to resolve conflicted merge, the sequencing "rebase" gives is certainly better than a hand-rolled loop:

	git rev-list --reverse ..... |
	while read commit
        do
        	git cherry-pick "$commit" || break
	done
though.

Using "git cherry-pick $(git rev-list --reverse .....)" ought to work. It may misbehave only if you have a time skewed commits, but the 'mz/cherry-pick-cmdline-order' topic recently fixed (it is in 'master' and will be in 1.8.0).

Previous: Peter KreftingNext: Andrew Wong
Message 2 of 5 in “Interactive rebase with pre-built script?”
  1. Peter KreftingSep 11, 2012
  2. Junio C HamanoSep 11, 2012
  3. Andrew WongSep 12, 2012
  4. Peter KreftingSep 13, 2012
  5. Andrew WongSep 13, 2012

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.