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

Re: [PATCH v6] merge-tree: add -X strategy option

From
Jeff King <peff@peff.net>
Date
Oct 11, 2023, 21:43 UTC
Message-ID
<20231011214340.GA518221@coredump.intra.peff.net>
In-Reply-To
<xmqqlec9kl0k.fsf@gitster.g>
On Wed, Oct 11, 2023 at 12:38:03PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> If we have no plan and intention to extend "merge-tree" even more in
> the future, then option 1 would be the approach with least patch
> noise, and as your "something like this" shows, it is a nice and
> clean solution.  I very much like it.
> 
> But as the renovated "merge-tree" is a relatively young thing in our
> toolbox, I suspect that more and more work may want to go into it.
> And the other "official copy_merge_options()" approach would be a
> more healthy solution in the longer run, I would think.  If we were
> to go that route, we should also give an interface to free the
> resources held by the copy.

I am happy with either, as they both resolve the "merge-tree knows intimate details about merge_options" issue. The patch I showed would require manually passing more details down to real_merge(), which is I guess what you are getting at with the "more work may want to go into it".

> It is not that much code on top of the commit that is already queued
> in 'next', I suspect.  Perhaps something like this?
This looks OK, though...
> +void clear_merge_options(struct merge_options *opt UNUSED)
> +{
> +	; /* no-op as our copy is shallow right now */
> +}

Clearing is generally not just about copies, but any use of the struct. so this invites the question of whether the original non-copy struct should have a call to clear_merge_options() in cmd_merge_tree(). And ditto for every other user.

I do not mind adding such calls, but of course we know that they are currently noops (and we don't have any particular plan to change that).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 26 of 27 in “merge-tree: add -X strategy option”
  1. merge-tree: add -X strategy optionIzzy via GitGitGadget, Aug 5, 2023
  2. Junio C HamanoAug 7, 2023
  3. merge-tree: add -X strategy optionIzzy via GitGitGadget, Aug 12, 2023
  4. 唐宇奕Aug 12, 2023
  5. 唐宇奕Sep 3, 2023
  6. Elijah NewrenSep 12, 2023
  7. merge-tree: add -X strategy optionIzzy via GitGitGadget, Sep 16, 2023
  8. 唐宇奕Sep 16, 2023
  9. Elijah NewrenSep 16, 2023
  10. Elijah NewrenSep 16, 2023
  11. merge-tree: add -X strategy optionIzzy via GitGitGadget, Sep 16, 2023
  12. Elijah NewrenSep 16, 2023
  13. 唐宇奕Sep 16, 2023
  14. Jeff KingSep 16, 2023
  15. merge-tree: add -X strategy optionIzzy via GitGitGadget, Sep 16, 2023
  16. 唐宇奕Sep 16, 2023
  17. Phillip WoodSep 18, 2023
  18. Junio C HamanoSep 18, 2023
  19. merge-tree: add -X strategy optionIzzy via GitGitGadget, Sep 24, 2023
  20. 唐宇奕Sep 24, 2023
  21. Phillip WoodOct 9, 2023
  22. Jeff KingOct 9, 2023
  23. Junio C HamanoOct 9, 2023
  24. Jeff KingOct 9, 2023
  25. Junio C HamanoOct 11, 2023
  26. Jeff KingOct 11, 2023
  27. Junio C HamanoOct 11, 2023

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.