* Difference between 'git rebase' and 'git rebase -m'
@ 2010-11-16 17:35 Joshua Jensen
2010-11-16 18:27 ` Jonathan Nieder
0 siblings, 1 reply; 5+ messages in thread
From: Joshua Jensen @ 2010-11-16 17:35 UTC (permalink / raw)
To: git@vger.kernel.org
We ran into an interesting issue yesterday during a rebase.
User Bob had added a line at the same place in a (C++) .h file as User
Joe, who had already pushed his one line change. The natural
expectation would be a conflict during User Bob's rebase operation, but,
in fact, the conflicting patch applied without difficulty.
After an investigation, we discovered this particular file had a near
duplicate of its C++ class definition immediately following the original
but renamed into a thread-safe version; the rename of the class was the
only change to its contents. The default 'git rebase' operation looked
some 150 lines into the file, discovered the patch didn't match due to
User Joe's added line, continued scanning the file until it found
another matching location some 300 lines later (the near duplicate
thread-safe version of the class), and applied the patch there.
While coming up with a repro to post here, we cherry picked the
individual changes and found the cherry pick properly conflicted.
We further discovered 'git rebase -m' (or 'git rebase -s recursive')
also conflicted at the User Bob/Joe modification.
I can post a repro here, if needed.
I'm curious as to why 'git rebase -m' isn't the default and what the
real difference is between 'git rebase' and 'git rebase -m'.
Additionally, is there any documentation describing how the patch
algorithm determines context?
Thanks!
Josh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Difference between 'git rebase' and 'git rebase -m'
2010-11-16 17:35 Difference between 'git rebase' and 'git rebase -m' Joshua Jensen
@ 2010-11-16 18:27 ` Jonathan Nieder
2010-11-17 11:43 ` Nguyen Thai Ngoc Duy
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Nieder @ 2010-11-16 18:27 UTC (permalink / raw)
To: Joshua Jensen; +Cc: git@vger.kernel.org, Stephen Bash
Joshua Jensen wrote:
> I'm curious as to why 'git rebase -m' isn't the default and what the
> real difference is between 'git rebase' and 'git rebase -m'.
git rebase is faster. :)
git rebase works by formatting a patch series and applying it.
git rebase -m uses repeated 3-way merge and should be more robust.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Difference between 'git rebase' and 'git rebase -m'
2010-11-16 18:27 ` Jonathan Nieder
@ 2010-11-17 11:43 ` Nguyen Thai Ngoc Duy
2010-11-17 13:36 ` Michael J Gruber
0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-11-17 11:43 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Joshua Jensen, git@vger.kernel.org, Stephen Bash
On Wed, Nov 17, 2010 at 1:27 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Joshua Jensen wrote:
>
>> I'm curious as to why 'git rebase -m' isn't the default and what the
>> real difference is between 'git rebase' and 'git rebase -m'.
>
> git rebase is faster. :)
Perhaps a config option to let people to default to -m. Or perhaps
they can just make an alias.
By the way, can we make rebase even faster? Rebasing ~20 patches or
more seems slow to me. I don't know much how patching works though.
--
Duy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Difference between 'git rebase' and 'git rebase -m'
2010-11-17 11:43 ` Nguyen Thai Ngoc Duy
@ 2010-11-17 13:36 ` Michael J Gruber
2010-11-17 14:38 ` Nguyen Thai Ngoc Duy
0 siblings, 1 reply; 5+ messages in thread
From: Michael J Gruber @ 2010-11-17 13:36 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy
Cc: Jonathan Nieder, Joshua Jensen, git@vger.kernel.org, Stephen Bash
Nguyen Thai Ngoc Duy venit, vidit, dixit 17.11.2010 12:43:
> On Wed, Nov 17, 2010 at 1:27 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Joshua Jensen wrote:
>>
>>> I'm curious as to why 'git rebase -m' isn't the default and what the
>>> real difference is between 'git rebase' and 'git rebase -m'.
>>
>> git rebase is faster. :)
>
> Perhaps a config option to let people to default to -m. Or perhaps
> they can just make an alias.
>
> By the way, can we make rebase even faster? Rebasing ~20 patches or
> more seems slow to me. I don't know much how patching works though.
git sequencer...
Michael
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Difference between 'git rebase' and 'git rebase -m'
2010-11-17 13:36 ` Michael J Gruber
@ 2010-11-17 14:38 ` Nguyen Thai Ngoc Duy
0 siblings, 0 replies; 5+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-11-17 14:38 UTC (permalink / raw)
To: Michael J Gruber
Cc: Jonathan Nieder, Joshua Jensen, git@vger.kernel.org, Stephen Bash
On Wed, Nov 17, 2010 at 8:36 PM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Nguyen Thai Ngoc Duy venit, vidit, dixit 17.11.2010 12:43:
>> On Wed, Nov 17, 2010 at 1:27 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>>> Joshua Jensen wrote:
>>>
>>>> I'm curious as to why 'git rebase -m' isn't the default and what the
>>>> real difference is between 'git rebase' and 'git rebase -m'.
>>>
>>> git rebase is faster. :)
>>
>> Perhaps a config option to let people to default to -m. Or perhaps
>> they can just make an alias.
>>
>> By the way, can we make rebase even faster? Rebasing ~20 patches or
>> more seems slow to me. I don't know much how patching works though.
>
> git sequencer...
Sequencer is definitely an improvement. But does it improve
performance? I don't know rebase internals but I think that it needs
to update worktree/index for every commit, which might slow things
down a bit.
--
Duy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-17 14:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-16 17:35 Difference between 'git rebase' and 'git rebase -m' Joshua Jensen
2010-11-16 18:27 ` Jonathan Nieder
2010-11-17 11:43 ` Nguyen Thai Ngoc Duy
2010-11-17 13:36 ` Michael J Gruber
2010-11-17 14:38 ` Nguyen Thai Ngoc Duy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).