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

Re: [PATCH 2/2] Teach rebase an interactive mode

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 24, 2007, 14:33 UTC
Message-ID
<Pine.LNX.4.64.0706241533030.4059@racer.site>
In-Reply-To
<7v4pkxydim.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sun, 24 Jun 2007, Junio C Hamano wrote:
Show 31 quoted lines
> This is just an idea, but I have been wondering if it would be useful if 
> we teach rebase (interactive or not) to handle a merge from an unrelated 
> (wrt the rebase that is being performed) branch.  That is, if you had 
> this development on top of the origin 'O':
> 
>              X
>               \  
>            A---M---B     
>           /
>   ---o---O
> 
> that you committed A, merged X and then committed B, you should
> be able to rebase on top of an updated upstream 'Q':
> 
>              X
>               \  
>            A---M---B     
>           /
>   ---o---O---P---Q
> 
> by 'pick A/merge M/pick B', which would do:
> 
>                      X
>                       \
>                    A'--M'--B'
>                   /
>   ---o---O---P---Q
> 
> Note that A', M' and B' are different commit objects (rebase
> rewrites the history) from the original picture, but X is the
> same commit from the original picture.

Yes, I think that would be useful. But at the same time, I think it should not be the default. Why? Because I will use rebase to beautify my history, and that looks mostly like this:

--- A - B - C - D - E - junio/master
      \       \   \
        M - N - O - P - my
So what I want is really clean up my side branch.

Therefore I would like to have this --preserve-merges (short option -p?) _after_ rebase -i.

It will get a little tricky with different merge strategies, and saying which commits have to be rebased (A in your example), and which will be preserved (X in your example), and evil merges (merges which have fix ups in addition to the merge), but doable.

Ciao, Dscho

Previous: Johannes Schindelin
Message 10 of 10 in “Teach rebase an interactive mode”
  1. 2/2 Teach rebase an interactive modeJohannes Schindelin, Jun 23, 2007
  2. Alex RiesenJun 23, 2007
  3. Johannes SchindelinJun 23, 2007
  4. Brian GernhardtJun 24, 2007
  5. Johannes SchindelinJun 24, 2007
  6. Junio C HamanoJun 24, 2007
  7. Johannes SchindelinJun 24, 2007
  8. 1/2 Move the pick_author code to git-sh-setupJohannes Schindelin, Jun 25, 2007
  9. 2/2 Teach rebase an interactive modeJohannes Schindelin, Jun 25, 2007
  10. Johannes SchindelinJun 24, 2007

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.