git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Google Summer of Code 2009: GIT

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2009, 19:36 UTC
Message-ID
<7vtz5z4zsx.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<49B74373.3090609@gmail.com>
Saurabh Gupta <saurabhgupta1403@gmail.com> writes:
> *1) Domain specific merge helpers*
> Intelligence in the merger can be put which modifies the source file
> according the format. Different file formats can be put in the merger
> to support.
The way "merge" works is:
 - A tree-level 3-way merge is done (either inside merge-recursive backend
   or with "read-tree -m O A B" inside merge-resolve), and trivial merges
   are resolved at the whole-file level without need for any helper.
   Roughly speaking, the definition of "a trivially mergeable path" is a
   path that only one side modified while the other side didn't, or both
   sides modified identically.
 - The remaining paths need to be merged at file level.  The gitattributes
   mechanism is used to decide what exact algorithm to use based on what
   the merged file is; we have a plain-text "xdl" merge driver and "union"
   merge driver built-in, in addition to "binary" merge driver (which
   always says "the changes conflict; use ours as a tentative result).
   When a merge driver is called, it is given three blobs: original, ours
   and theirs (any one of them could be missing).  It is the driver's
   responsibility to come up with an automated merge result when the
   changes do not overlap and report success, or leave an intermediate
   "conflicted merge" and report conflicts.  In either case, the driver is
   expected to return _one_ single bytestream as its tentative result.
 - Cleanly merged paths are updated in the index and their results are
   written out to the work tree.  For paths the merge drivers reported
   conflicts, tentative results returned by the merge drivers are written
   out to the work tree but the index entries for them are left in an
   unmerged state.
 - If all paths are cleanly merged, "git merge" and friends write the
   index out as a tree and create a commit out of it (unless otherwise
   instructed) and report success.
 - When a merge left conflicts, the user can use external tools like "git
   mergetool" to resolve the conflict in the work tree, starting from the
   tentative result given by the merge driver, and "git add" to register
   the resolution to the index.

When people say a "merge helper" in the context of git, I think they think about at least two kinds, that work at very different layers. It is unclear which one you are more interested in, or you are tackling both.

 - A group of new merge drivers that handle various structured text
   formats (e.g. XML based ones), on which the default plain-text merge is
   not suitable, would be a good addition to the git suite.  If you are
   interested in doing this as your GSoC project, it would very much be
   git specific.
 - Amerge helper that takes three files (original, ours and theirs) as its
   input and helps the end user (perhaps graphically) merge them can be
   used at a backend to the "git-mergetool", by registering a filetype as
   "binary" (so that the low-level merge driver won't even try merging the
   contents at the file level), and letting "git-mergetool" invoke the
   "helper" with these three files.  The development of this kind of
   "helper" would not be a git specific project.

Obviously it would help the users to have both, but which kind is more important?

In a collaborative environment, people do not work in void without any communication with each other, and they actively try not to step on each other's toes. Even when changes are made from both sides of a merge to the same file (in other words, a file level merge is required), in the majority of cases, the changes do not overlap, and being able to resolve such merges cleanly most of the time, without having to resort to an external "git mergetool", is a huge win in productivity. I think a domain specific "merge driver" project would benefit the git users a lot more than a domain specific "merge helper" that can be used as a "git mergetool" backend (and can also be used outside git).

Of course, you can do both.

But my point is it is unclear which one you meant when you said "merge helper".

Previous: saurabh guptaNext: saurabh gupta
Message 47 of 76 in “Google Summer of Code 2009: GIT”
  1. Saurabh GuptaMar 11, 2009
  2. Daniel BarkalowMar 11, 2009
  3. David SymondsMar 11, 2009
  4. saurabh guptaMar 11, 2009
  5. Johannes SchindelinMar 11, 2009
  6. David SymondsMar 11, 2009
  7. Johannes SchindelinMar 11, 2009
  8. Johannes SchindelinMar 11, 2009
  9. saurabh guptaMar 11, 2009
  10. Johannes SchindelinMar 11, 2009
  11. saurabh guptaMar 11, 2009
  12. Johannes SchindelinMar 11, 2009
  13. saurabh guptaMar 11, 2009
  14. Rogan DawesMar 11, 2009
  15. saurabh guptaMar 11, 2009
  16. Johannes SchindelinMar 11, 2009
  17. saurabh guptaMar 11, 2009
  18. Daniel BarkalowMar 11, 2009
  19. Johannes SchindelinMar 11, 2009
  20. Michael J GruberMar 12, 2009
  21. Johannes SchindelinMar 12, 2009
  22. Michael J GruberMar 12, 2009
  23. david@lang.hmMar 12, 2009
  24. saurabh guptaMar 11, 2009
  25. Michael J GruberMar 12, 2009
  26. david@lang.hmMar 11, 2009
  27. Johannes SchindelinMar 11, 2009
  28. david@lang.hmMar 11, 2009
  29. Johannes SchindelinMar 11, 2009
  30. saurabh guptaMar 11, 2009
  31. david@lang.hmMar 11, 2009
  32. saurabh guptaMar 11, 2009
  33. david@lang.hmMar 11, 2009
  34. Johannes SchindelinMar 11, 2009
  35. david@lang.hmMar 11, 2009
  36. Junio C HamanoMar 11, 2009
  37. thestar@fussycoder.id.auMar 12, 2009
  38. Junio C HamanoMar 12, 2009
  39. saurabh guptaMar 12, 2009
  40. david@lang.hmMar 12, 2009
  41. Junio C HamanoMar 12, 2009
  42. saurabh guptaMar 12, 2009
  43. david@lang.hmMar 12, 2009
  44. saurabh guptaMar 12, 2009
  45. Rogan DawesMar 13, 2009
  46. saurabh guptaMar 13, 2009
  47. Junio C HamanoMar 11, 2009
  48. saurabh guptaMar 11, 2009
  49. david@lang.hmMar 12, 2009
  50. saurabh guptaMar 12, 2009
  51. david@lang.hmMar 12, 2009
  52. saurabh guptaMar 12, 2009
  53. david@lang.hmMar 12, 2009
  54. saurabh guptaMar 12, 2009
  55. david@lang.hmMar 12, 2009
  56. saurabh guptaMar 13, 2009
  57. Johannes SchindelinMar 18, 2009
  58. david@lang.hmMar 18, 2009
  59. Johannes SchindelinMar 19, 2009
  60. david@lang.hmMar 19, 2009
  61. Johannes SchindelinMar 19, 2009
  62. david@lang.hmMar 19, 2009
  63. saurabh guptaMar 19, 2009
  64. Caleb CushingMar 19, 2009
  65. Johannes SchindelinMar 19, 2009
  66. Caleb CushingMar 21, 2009
  67. saurabh guptaMar 19, 2009
  68. Johannes SchindelinMar 19, 2009
  69. david@lang.hmMar 20, 2009
  70. Johannes SchindelinMar 20, 2009
  71. david@lang.hmMar 20, 2009
  72. Johannes SchindelinMar 20, 2009
  73. david@lang.hmMar 20, 2009
  74. saurabh guptaMar 21, 2009
  75. Junio C HamanoMar 12, 2009
  76. saurabh guptaMar 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.