git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Jensen <jjensen@workspacewhiz.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Difference between 'git rebase' and 'git rebase -m'
Date: Tue, 16 Nov 2010 10:35:41 -0700	[thread overview]
Message-ID: <4CE2C0ED.1030309@workspacewhiz.com> (raw)

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

             reply	other threads:[~2010-11-16 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 17:35 Joshua Jensen [this message]
2010-11-16 18:27 ` Difference between 'git rebase' and 'git rebase -m' 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE2C0ED.1030309@workspacewhiz.com \
    --to=jjensen@workspacewhiz.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).