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

Re: Anomalous conflicts during git rebase

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Dec 28, 2007, 18:54 UTC
Message-ID
<20071228185449.GA30574@atjola.homenet>
In-Reply-To
<m3fxxm7jp6.fsf@euroclydon.lan>
On 2007.12.28 12:33:41 -0600, adr3nald0s@gmail.com wrote:
Show 21 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > On Fri, 28 Dec 2007, adr3nald0s@gmail.com wrote:
> >
> >> When you say it linearizes history how is this done.
> >
> > Rebase takes a list of commits that are in the current branch and 
> > aren't in the origin branch as what it's going to work on; these are 
> > ordered in some arbitrary way such that children always follow parents. It 
> > then resets to the origin branch's commit, and, in sequence, cherry-picks 
> > each of the commits in the working list.
> 
> Thanks again for the clear explanation.
> 
> > In theory, of course, it could try to resolve conflicts by looking through 
> > the rest of the list for merges which would have those conflicts and using 
> > what that merge did.  
> 
> Given the implementation, this would be just plain ugly.  I would not
> want to attempt to implement something like this, nor would I expect
> anyone else to do so.

I wouldn't make sense either. The conflict resolution that was done in the merge commit might need stuff from commits that haven't been rebased yet. For example a new function that was introduced later, it was available for the merge, but is still missing from the rebased linear history.

That said, what _might_ make sense is to teach interactive rebase with -p to use "cherry-pick -m1" or whatever instead of "merge" to recreate the merge commits (or maybe it does that already now? didn't check...). That way, it wouldn't have to rely on rerere being enabled to avoid the repeated resolving of the merge conflicts. I'm not sure how that would need to interact with new changes introduces into one of the rewritten branches.

Björn
Previous: adr3nald0s@gmail.com
Message 8 of 8 in “Anomalous conflicts during git rebase”
  1. adr3nald0s@gmail.comDec 27, 2007
  2. Johannes SixtDec 27, 2007
  3. adr3nald0s@gmail.comDec 28, 2007
  4. Daniel BarkalowDec 27, 2007
  5. adr3nald0s@gmail.comDec 28, 2007
  6. Daniel BarkalowDec 28, 2007
  7. adr3nald0s@gmail.comDec 28, 2007
  8. Björn SteinbrinkDec 28, 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.