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

Re: [RFC PATCH 0/2] Introduce new merge-tree-ort command

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 7, 2022, 19:54 UTC
Message-ID
<nycvar.QRO.7.76.6.2201072044120.339@tvgsbejvaqbjf.bet>
In-Reply-To
<CAP8UFD0wKnAg5oyMWchXysPTg3K9Vb4M1tRcPzPE81QM903pYg@mail.gmail.com>
Hi Christian,
On Fri, 7 Jan 2022, Christian Couder wrote:
Show 11 quoted lines
> On Wed, Jan 5, 2022 at 5:54 PM Elijah Newren <newren@gmail.com> wrote:
> >
> > On Wed, Jan 5, 2022 at 8:33 AM Christian Couder
> > <christian.couder@gmail.com> wrote:
>
> > > To move forward on this, this small RFC patch series introduces a
> > > new `git merge-tree-ort` command with the following design:
> >
> > Slightly dislike the command name.
>
> I am ok with changing the command name.
Or just going with `merge-tree`?

That command name has the distinct advantage of _already_ being used by Git. So there is no chance for users to have a `git-merge-tree` script lying around that all of a sudden would stop working because a superseding built-in using the same name is introduced.

That is a distinct advantage of using the existing command for the new code flow, even if the command name could be interpreted as misleading. Of course, the name could also be construed to be on point: it merges, and it produces a tree, hence "merge-tree".

Show 10 quoted lines
> > >   - the diff API, actually diff_tree_oid() is called 3 times: once for
> > >     the diff versus branch1 ("ours"), once for the diff versus branch2
> > >     ("theirs"), and once for the diff versus the base.
> >
> > Why?  That seems to be a performance penalty for anyone that doesn't
> > want/need the diffs, and since we return a tree, a caller can go and
> > get whatever diffs they like.
>
> I say somewhere else that I am planning to add options to disable this
> or parts of this diff output.

Well, now you got me really curious. Since you are listed as part of GitLab (https://about.gitlab.com/company/team/#chriscool), I assume that you are pretty familiar with how merges are done on GitLab's server side, and plan on experimenting with your own work to use `merge-ort` on GitLab's servers.

Which makes me wonder where that idea comes from to use the diff API?

What operations does GitLab need from that Git command, which code flows need to be supported (and what inputs/outputs are there)?

Show 14 quoted lines
> I think it's still interesting for the command to be able to output
> diffs, especially diffs of conflicting parts. In [2] Ævar said:
>
> => I.e. I'm not the first or last to have (not for anything serious)
> => implement a dry-run bare-repo merge with something like:
> =>
> =>     git merge-tree origin/master git-for-windows/main origin/seen >diff
> =>     # Better regex needed, but basically this
> =>     grep "^\+<<<<<<< \.our$" diff && conflict=t
>
> Also `git merge-tree` currently outputs diffs, so I thought it would
> be sad if the new command couldn't do it.
>
> [2] https://lore.kernel.org/git/211109.861r3qdpt8.gmgdl@evledraar.gmail.com/

But `git merge-tree` was only meant as a proof-of-concept, intended to entice other developers to turn it into something useful. As it took _this_ long, we can safely assume that the user interface of `merge-tree` left a bit of a room for improvement. Wouldn't you agree?

> Also I thought that you might not be interested in this anymore as you
> didn't reply to [1] and [2] where Ævar and I both said that we were
> interested in your opinion on a git merge-tree on steroids.
Elijah stated at the time that he was scarce on time for Git.

But back to the topic: have you played with using `merge-ort` in GitLab already? What were the needs you saw that would be required of the Git command, what flows would it have to support?

Ciao, Johannes

Previous: Johannes Schindelin
Message 28 of 28 in “Introduce new merge-tree-ort command”
  1. 0/2 Introduce new merge-tree-ort commandChristian Couder, Jan 5, 2022
  2. 1/2 merge-ort: add new merge-tree-ort commandChristian Couder, Jan 5, 2022
  3. Elijah NewrenJan 5, 2022
  4. 2/2 merge-ort: add t/t4310-merge-tree-ort.shChristian Couder, Jan 5, 2022
  5. Elijah NewrenJan 5, 2022
  6. Elijah NewrenJan 5, 2022
  7. Elijah NewrenJan 5, 2022
  8. Christian CouderJan 7, 2022
  9. Elijah NewrenJan 7, 2022
  10. Johannes SchindelinJan 10, 2022
  11. Junio C HamanoJan 10, 2022
  12. Johannes SchindelinJan 11, 2022
  13. Ævar Arnfjörð BjarmasonJan 11, 2022
  14. Elijah NewrenJan 11, 2022
  15. Junio C HamanoJan 12, 2022
  16. Elijah NewrenJan 12, 2022
  17. Junio C HamanoJan 13, 2022
  18. Elijah NewrenJan 13, 2022
  19. Ævar Arnfjörð BjarmasonJan 13, 2022
  20. Junio C HamanoJan 12, 2022
  21. Ævar Arnfjörð BjarmasonJan 13, 2022
  22. Elijah NewrenJan 10, 2022
  23. Elijah NewrenJan 11, 2022
  24. Johannes SchindelinFeb 22, 2022
  25. Johannes SchindelinJan 11, 2022
  26. Elijah NewrenJan 12, 2022
  27. Johannes SchindelinFeb 22, 2022
  28. Johannes SchindelinJan 7, 2022

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.