Hi Philip,

Am 2013-01-06 18:21, schrieb Philip Oakley:
Your issue [my mistake] is that the (gits's) merge process is a three way 
merge, so you
have the two commits F and N to merge, but git will also locate the merge-base 
at M
(which has the old directory structure), and compares the diffs between them 
[M-F] and
[M-N] (AFAIKI), so you will get these hundreds (thousands) of renames on that 
basis, and
a great difficulty in (git) trying to decide what to do.

Thank you very much for that explanation, it helps me a lot with understanding 
this!

So I'm thinking that it would be useful to have a merge commit, if possible, 
immediately
before the two flag day change commits, and then adjust the level of rename 
detection
(--rename-threshold) on the subsequent merge. (can't remember the default 
threshold)

I had this (a helper merge commit), indeed not strictly immediately before the flag day change commit, but close enough so that I should have recognized if the affected files from the few intermediate commits (between the last merge commit and D) were involved in or responsible for the conflicts.

However, it rather looked as if a main source of trouble were a large number of index.html "sentinel" files: As they all have the exact same contents, it seemed that the rename detection started to associate files at completely different, unrelated paths with each other.

Also you could simply try an Ours/Theirs strategy (as appropriate) which would 
stop git
trying to do more than it needs to, given that you will already have carefully 
made the
two tree 'compatible' ;-) which will establish a new merge base for future 
merges.

Ah!!  :-)

I really should have thought of trying this myself. Using
    git merge -s ours master
worked quickly and without any problems, and created the new merge commit G just as expected.

However, I'm unsure if this is the proper solution:
Of course, logically I expected that commits F and G have the same tree (as G's only purpose is to serve as a new merge basis), even if G was created with the default merge strategy. The "ours" strategy does exactly that (refer to same tree in G) quasi on the direct route, per definition.

But I wonder if this argument is enough?
That is, do I understand correctly that if I had used the default merge strategy, and somehow solved all the conflicts (so that none of the files had been changed from F), the result would have technically been exactly the same?

Best regards,
Carsten



--
   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
          Learn more at http://www.cafu.de

--


Reply via email to