git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about git-merge-stupid
@ 2008-07-03 12:33 Miklos Vajna
  2008-07-03 17:08 ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Miklos Vajna @ 2008-07-03 12:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git, Junio C Hamano, Johannes Schindelin

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

Hi,

I'm trying to understand what is the difference between different merge
strategies. git-merge-stupid is something I failed to understand from
the git history/code/documentation, so I'm asking here.

1) From git history:

It seems git-merge-stupid was created by 2276aa6 when Junio renamed
-resolve to -stupid and let -resolve use read-tree. Actually

        git show 2276aa6:git-merge-stupid.sh

says -stupid uses read-tree as well.

2) From code:

It seems -stupid is better than -resolve when there are multiple bases.
-resolve just passes all bases to read-tree, while -stupid tries to find
the best one. It does it by counting unmerged entries and the less one
is a better.

Here is what I tried:

A - B - C
      X   \
  \ D - E - F

(Where 'A' adds 'a.c' while the contents 'a', etc.)

$ git reset --hard e
$ git merge -s resolve c
Trying simple merge.
Merge made by resolve.

So it seems resolve does not completely fail if there are multiple
bases, either.

I would like to write a testcase that ensures git-merge-stupid really
picks the best base, but I don't know exactly in what situation can the
number of unmerged entires differ.

3) From documentation:

Actually -stupid is missing from Documentation/merge-strategies.txt. I
plan to send a patch to add it, once I understnad what it does. :-)

Thanks.

[ Writing to Linus as suggested by Dscho, adding Junio to CC as -
according to git log - both strategy created by him. ]

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-07-05 21:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03 12:33 Question about git-merge-stupid Miklos Vajna
2008-07-03 17:08 ` Linus Torvalds
2008-07-03 23:18   ` [RFC/PATCH] Remove 'stupid' merge strategy Miklos Vajna
2008-07-03 23:54   ` Question about git-merge-stupid Junio C Hamano
2008-07-04  0:07     ` Miklos Vajna
2008-07-05 14:43       ` [PATCH] Move 'stupid' merge strategy to contrib Miklos Vajna
2008-07-05 21:00         ` Miklos Vajna

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).