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
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 11, 2022, 17:00 UTC
Message-ID
<220111.86mtk2xb1y.gmgdl@evledraar.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.2201111439190.1081@tvgsbejvaqbjf.bet>
On Tue, Jan 11 2022, Johannes Schindelin wrote:
Show 33 quoted lines
> Hi Junio,
>
> On Mon, 10 Jan 2022, Junio C Hamano wrote:
>
>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>>
>> > I am against a new command for what essentially serves the original
>> > purpose of `merge-tree`.
>> >
>> > The fact that `merge-tree` has not seen any work in almost 12 years is
>> > testament not only to how hard it was to disentangle the work-tree
>> > requirement from the recursive merge (it is one of my favorite
>> > counterexamples when anybody claims that you can easily prototype code in
>> > a script and then convert it to C), but the fact that there is no user
>> > within Git itself (apart from t/t4300-merge-tree.sh, which does not count)
>> > speaks volumes about the design of that `merge-tree` tool.
>> >
>> > So it's only fair to breathe life into it by letting it do what it was
>> > meant to do all along.
>>
>> My "Yup" would not weigh as much as one that Linus (whose original
>> merge-tree survived this long without seeing much enhancements)
>> might give us, but he is busy elsewhere so you guys have to live
>> with mine ;-)
>>
>> As to its output, I do agree that "we give a tree when it is already
>> usable to record in a new commit" is a valuable option to have.  The
>> original behaviour should be made available somehow, for those who
>> built their workflow (including scripts) around it, though.
>
> No, I don't think it is a good idea to keep the original behavior around
> indefinitely, when it is totally unclear whether there actually _is_ any
> user of this feature out there.

For what it's worth I've used it for some automation at an ex-employer at least once. Grepping through my #*git* IRC logs there's a few mentions of it, and likewise for StackOverflow.

I'm not opposed to replacing it, and I think that probably in-the-wild users of it are almost certainly just grepping for the conflict markers to see if there's conflicts, or parsing which files have them etc.

So if we can provide a better interface that they can use (or even make git merge-tree a thin wrapper...).

Show 7 quoted lines
> We intentionally broke any existing users of `git-parse-remote.sh` by
> removing it, when that feature was much more likely to be used in scripts
> than `git merge-tree`. We cannot say on the one hand that we will get rid
> of some useful script just because we don't want the maintenance burden
> when on the other hand trying to keep support for an operation that is
> unlikely to have any users. That does not compute.  (And don't get hung up
> on the specific example of `git-parse-remote.sh`[...]

The specific example or case really matters. We don't have some generic flowchart for deprecating things that applies in all cases.

I removed git-parse-remote.sh in a89a2fbfccd (parse-remote: remove this now-unused library, 2020-11-14) and had the opposite impression you're expressing here.

I.e. searching around for in-the-wild uses via search engines, stack overflow etc. either found nothing interesting, or just a reflection of ourselves (i.e. generated manpages etc.).

That along with its history, i.e. it wasn't *really* meant for out-of-tree exposure if you look at the history of how it came about, it was just made at a time when similar libraries had similar manpages etc. added as a template.

Maybe that was the right thing to do, maybe not, but it went out with v2.30.0 and the lack of complaints since then would seem to suggest that I was right that removing it wouldn't be a big deal.

Of course it may have broken someone's script somewhere.

But an important distinction is that they can get it working again by just copy/pasting that ~100 line shell library into their own script, or calling the underlying commands it was invoking themselves.

Which doesn't apply to "git merge-tree" unless we come up with a replacement, and even then a 1=1 port of some in-the-wild code might be much harder, i.e. if it's deeply coupled to parsing the specific output it emits now.

So I'd personally be much more hesitant to remove or change that, but of course we might still come up with good reasons for why it's worth it, especially with some advertised deprecation period.

And isn't any doubt around that even more reason to just go with Elijah's plan of introducing new plumbing? I.e. is it really costing us to just leave these "legacy merge" plumbing built-ins and merge-recursive.c etc. in place?

Previous: Johannes SchindelinNext: Elijah Newren
Message 13 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.