Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

Re: git rebase + fuzz = possible bad merge

From: Benny Halevy <hidden>
Date: 2016-06-15 22:46:27

On Mar. 23, 2009, 16:06 +0200, Benny Halevy [off-list ref] wrote:
On Mar. 23, 2009, 15:54 +0200, Thomas Rast [off-list ref] wrote:
quoted
Benny Halevy wrote:
quoted
I'm hitting bad merges with (non interactive) git rebase
when a hunk is merged pre-maturely into an inexact match
when there's fuzz.
[...]
quoted
{ for i in {1..10}; do echo fuzz $i; done; echo; cat test_file; } > fuzz_file
[...]
quoted
git rebase --onto test_branch master^ master
git-am, and by extension rebase, by default doesn't take history into
account.  It just applies the patches "blindly".  ...
git am, in contrast to git rebase, errs on fuzz and you'll need to
apply the patch manually.  It might be annoying, but it'd be safer
if git rebase would either stop on fuzz too or revert to using
merge strategies (same as using git rebase -m) by default.
quoted
...  Thus, there's no way
to know which series of 'line N' you really wanted it to go onto.
Well, there's the hunk header.

Benny
quoted
To avoid this issue, use the -m option to git-rebase so that it uses a
"real" merge.  (You can achieve similar effects for git-am with the -3
option.)
OK. -m indeed helps and I'm certainly going to adopt it for my rebase scripts.
git rebase -i does too, BTW.

I would expect though that the default mode for automatic rebase would be
the strictest and safest...

Benny
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help