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

Re: [PATCH v4 0/5] rebase: cleanup merge strategy option handling

From
Elijah Newren <newren@gmail.com>
Date
Apr 10, 2023, 16:46 UTC
Message-ID
<CABPp-BGUa_Aot_2iPmTWh1KvuL7mS4OSwXX-ArqgFSd8nU-+ig@mail.gmail.com>
In-Reply-To
<cover.1681117706.git.phillip.wood@dunelm.org.uk>
On Mon, Apr 10, 2023 at 2:08 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 8 quoted lines
>
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> Cleanup the handling of --strategy-option now that we no longer need to
> support "--preserve-merges" and properly quote the argument when saving
> it to disc.
>
> A hopefully final re-roll to fix a memory leak I spotted in V3.
Doh, I clearly missed that leak too.
Show 5 quoted lines
> Changes since V3:
>  - Fixed a memory leak added in V3. The array returned by
>    split_cmdline() is allocated on the heap so we need to fee it. The
>    array elements come from the string passed to split_cmdline() so do
>    not need to be individually freed.

And in particular, that string that stores those array elements will be freed by the strbuf_reset() that comes immediately after the read_strategy_opts() call (read_strategy_opts() is the sole caller of parse_strategy_opts()), and the fact that the string is freed is fine since your parse_strategy_opts() passes them to strvec_push() which will xstrdup() them and then own them.

All that to say I agree with the fix.
Previous: Phillip Wood
Message 36 of 36 in “rebase: cleanup merge strategy option handling”
  1. 0/4 rebase: cleanup merge strategy option handlingPhillip Wood, Mar 15, 2023
  2. 1/4 rebase: stop reading and writing unnecessary strategy statePhillip Wood, Mar 15, 2023
  3. 2/4 rebase -m: cleanup --strategy-option handlingPhillip Wood, Mar 15, 2023
  4. 3/4 rebase -m: fix serialization of strategy optionsPhillip Wood, Mar 15, 2023
  5. Elijah NewrenApr 1, 2023
  6. Phillip WoodApr 4, 2023
  7. 4/4 rebase: remove a couple of redundant strategy testsPhillip Wood, Mar 15, 2023
  8. Elijah NewrenApr 1, 2023
  9. Phillip WoodApr 4, 2023
  10. Junio C HamanoMar 15, 2023
  11. Felipe ContrerasMar 15, 2023
  12. Elijah NewrenApr 1, 2023
  13. 0/5 rebase: cleanup merge strategy option handlingPhillip Wood, Apr 5, 2023
  14. 1/5 rebase: stop reading and writing unnecessary strategy statePhillip Wood, Apr 5, 2023
  15. 3/5 rebase -m: cleanup --strategy-option handlingPhillip Wood, Apr 5, 2023
  16. 2/5 sequencer: use struct strvec to store merge strategy optionsPhillip Wood, Apr 5, 2023
  17. Elijah NewrenApr 7, 2023
  18. 4/5 rebase -m: fix serialization of strategy optionsPhillip Wood, Apr 5, 2023
  19. Elijah NewrenApr 7, 2023
  20. 5/5 rebase: remove a couple of redundant strategy testsPhillip Wood, Apr 5, 2023
  21. Elijah NewrenApr 7, 2023
  22. Phillip WoodApr 7, 2023
  23. Junio C HamanoApr 7, 2023
  24. 0/5 rebase: cleanup merge strategy option handlingPhillip Wood, Apr 7, 2023
  25. 1/5 rebase: stop reading and writing unnecessary strategy statePhillip Wood, Apr 7, 2023
  26. 2/5 sequencer: use struct strvec to store merge strategy optionsPhillip Wood, Apr 7, 2023
  27. 3/5 rebase -m: cleanup --strategy-option handlingPhillip Wood, Apr 7, 2023
  28. 4/5 rebase -m: fix serialization of strategy optionsPhillip Wood, Apr 7, 2023
  29. 5/5 rebase: remove a couple of redundant strategy testsPhillip Wood, Apr 7, 2023
  30. 0/5 rebase: cleanup merge strategy option handlingPhillip Wood, Apr 10, 2023
  31. 1/5 rebase: stop reading and writing unnecessary strategy statePhillip Wood, Apr 10, 2023
  32. 3/5 rebase -m: cleanup --strategy-option handlingPhillip Wood, Apr 10, 2023
  33. 2/5 sequencer: use struct strvec to store merge strategy optionsPhillip Wood, Apr 10, 2023
  34. 4/5 rebase -m: fix serialization of strategy optionsPhillip Wood, Apr 10, 2023
  35. 5/5 rebase: remove a couple of redundant strategy testsPhillip Wood, Apr 10, 2023
  36. Elijah NewrenApr 10, 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.