{"thread":{"id":"25763","subject":"Difference between 'git rebase' and 'git rebase -m'","startedAt":"2010-11-16T17:35:41Z","lastAt":"2010-11-17T14:38:38Z","messageCount":5,"participants":["Joshua Jensen","Jonathan Nieder","Nguyen Thai Ngoc Duy","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"156003","messageId":"4CE2C0ED.1030309@workspacewhiz.com","threadId":"25763","inReplyTo":null,"subject":"Difference between 'git rebase' and 'git rebase -m'","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2010-11-16T17:35:41Z","receivedAt":"2010-11-16T17:35:41Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"We ran into an interesting issue yesterday during a rebase.\n\nUser Bob had added a line at the same place in a (C++) .h file as User \nJoe, who had already pushed his one line change.  The natural \nexpectation would be a conflict during User Bob's rebase operation, but, \nin fact, the conflicting patch applied without difficulty.\n\nAfter an investigation, we discovered this particular file had a near \nduplicate of its C++ class definition immediately following the original \nbut renamed into a thread-safe version; the rename of the class was the \nonly change to its contents.  The default  'git rebase' operation looked \nsome 150 lines into the file, discovered the patch didn't match due to \nUser Joe's added line, continued scanning the file until it found \nanother matching location some 300 lines later (the near duplicate \nthread-safe version of the class), and applied the patch there.\n\nWhile coming up with a repro to post here, we cherry picked the \nindividual changes and found the cherry pick properly conflicted.\n\nWe further discovered 'git rebase -m' (or 'git rebase -s recursive') \nalso conflicted at the User Bob/Joe modification.\n\nI can post a repro here, if needed.\n\nI'm curious as to why 'git rebase -m' isn't the default and what the \nreal difference is between 'git rebase' and 'git rebase -m'.  \nAdditionally, is there any documentation describing how the patch \nalgorithm determines context?\n\nThanks!\n\nJosh\n"},{"id":"156009","messageId":"20101116182749.GC14552@burratino","threadId":"25763","inReplyTo":"4CE2C0ED.1030309@workspacewhiz.com","subject":"Re: Difference between 'git rebase' and 'git rebase -m'","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-16T18:27:49Z","receivedAt":"2010-11-16T18:27:49Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Joshua Jensen wrote:\n\n> I'm curious as to why 'git rebase -m' isn't the default and what the\n> real difference is between 'git rebase' and 'git rebase -m'.\n\ngit rebase is faster. :)\n\ngit rebase works by formatting a patch series and applying it.\ngit rebase -m uses repeated 3-way merge and should be more robust.\n"},{"id":"156043","messageId":"AANLkTik7RML10gyQ19OV0KAH8Mn3=VZe92kU1qxER7wO@mail.gmail.com","threadId":"25763","inReplyTo":"20101116182749.GC14552@burratino","subject":"Re: Difference between 'git rebase' and 'git rebase -m'","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-11-17T11:43:50Z","receivedAt":"2010-11-17T11:43:50Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 17, 2010 at 1:27 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Joshua Jensen wrote:\n>\n>> I'm curious as to why 'git rebase -m' isn't the default and what the\n>> real difference is between 'git rebase' and 'git rebase -m'.\n>\n> git rebase is faster. :)\n\nPerhaps a config option to let people to default to -m. Or perhaps\nthey can just make an alias.\n\nBy the way, can we make rebase even faster? Rebasing ~20 patches or\nmore seems slow to me. I don't know much how patching works though.\n-- \nDuy\n"},{"id":"156045","messageId":"4CE3DA66.80808@drmicha.warpmail.net","threadId":"25763","inReplyTo":"AANLkTik7RML10gyQ19OV0KAH8Mn3=VZe92kU1qxER7wO@mail.gmail.com","subject":"Re: Difference between 'git rebase' and 'git rebase -m'","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-11-17T13:36:38Z","receivedAt":"2010-11-17T13:36:38Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Nguyen Thai Ngoc Duy venit, vidit, dixit 17.11.2010 12:43:\n> On Wed, Nov 17, 2010 at 1:27 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Joshua Jensen wrote:\n>>\n>>> I'm curious as to why 'git rebase -m' isn't the default and what the\n>>> real difference is between 'git rebase' and 'git rebase -m'.\n>>\n>> git rebase is faster. :)\n> \n> Perhaps a config option to let people to default to -m. Or perhaps\n> they can just make an alias.\n> \n> By the way, can we make rebase even faster? Rebasing ~20 patches or\n> more seems slow to me. I don't know much how patching works though.\n\ngit sequencer...\n\nMichael\n"},{"id":"156047","messageId":"AANLkTikY0BE-PMP5TpAjL2TOYBQ-sTAAka2Gt6f8qd3P@mail.gmail.com","threadId":"25763","inReplyTo":"4CE3DA66.80808@drmicha.warpmail.net","subject":"Re: Difference between 'git rebase' and 'git rebase -m'","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-11-17T14:38:38Z","receivedAt":"2010-11-17T14:38:38Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 17, 2010 at 8:36 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Nguyen Thai Ngoc Duy venit, vidit, dixit 17.11.2010 12:43:\n>> On Wed, Nov 17, 2010 at 1:27 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>> Joshua Jensen wrote:\n>>>\n>>>> I'm curious as to why 'git rebase -m' isn't the default and what the\n>>>> real difference is between 'git rebase' and 'git rebase -m'.\n>>>\n>>> git rebase is faster. :)\n>>\n>> Perhaps a config option to let people to default to -m. Or perhaps\n>> they can just make an alias.\n>>\n>> By the way, can we make rebase even faster? Rebasing ~20 patches or\n>> more seems slow to me. I don't know much how patching works though.\n>\n> git sequencer...\n\nSequencer is definitely an improvement. But does it improve\nperformance? I don't know rebase internals but I think that it needs\nto update worktree/index for every commit, which might slow things\ndown a bit.\n-- \nDuy\n"}]}