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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 11, 2023, 22:19 UTC
Message-ID
<xmqqedi0kdjj.fsf@gitster.g>
In-Reply-To
<20231011214340.GA518221@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> 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".

I was alluding more about teaching "merge-tree" various optional behaviour merge_options represents. In today's patch it may be -X<options>, who knows what tomorrow's patch wants to bring "merge-tree" to feature-parity with "merge". And the first approach would mean we would add xopts today to the struct, but we will be required passing more details as we add other things.

Show 14 quoted lines
>> 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.

Yes, once we start leaking, somebody hopefully notice the lack of a call to this on the original/template copy and add one. Until then...

Previous: Jeff King
Message 27 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.