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

Re: [PATCH] rebase-i: keep old parents when preserving merges

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 16, 2008, 21:36 UTC
Message-ID
<7vd4ldpl3k.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1216173109-11155-1-git-send-email-s-beyer@gmx.net>
Stephan Beyer <s-beyer@gmx.net> writes:
... Based on the discussion thread, here is a rewrite of the log message.
Show 25 quoted lines
> When "rebase -i -p" tries to preserve merges of unrelated branches, it
> lost some parents:
>
>  - When you have more than two parents, the commit in the new history
>    ends up with fewer than expected number of parents and this breakage
>    goes unnoticed;
>
>  - When you are rebasing a merge with two parents and one is lost, the
>    command tries to cherry-pick the original merge commit, and the command
>    fails.
>
> Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index a35212d..0df7640 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -174,6 +174,8 @@ pick_one_preserving_merges () {
>  				new_parents="$new_parents $new_p"
>  				;;
>  			esac
> +		else
> +			new_parents="$new_parents $p"
>  		fi
>  	done

Reading the surrounding code, it makes me wonder if you also need to futz with variables like $preserve and $fast_forward.

Previous: Johannes SchindelinNext: Stephan Beyer
Message 6 of 7 in “rebase-i: keep old parents when preserving merges”
  1. rebase-i: keep old parents when preserving mergesStephan Beyer, Jul 16, 2008
  2. Stephan BeyerJul 16, 2008
  3. Johannes SchindelinJul 16, 2008
  4. Stephan BeyerJul 16, 2008
  5. Johannes SchindelinJul 16, 2008
  6. Junio C HamanoJul 16, 2008
  7. Stephan BeyerJul 16, 2008

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.