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

Re: [PATCH 1/2] difftool: use "struct strvec" API in run_{dir,file}_diff()

From
Jeff King <peff@peff.net>
Date
Sep 12, 2021, 22:41 UTC
Message-ID
<YT6CMdITxaZZqufr@coredump.intra.peff.net>
In-Reply-To
<YT6BnnXeAWn8BycF@coredump.intra.peff.net>
On Sun, Sep 12, 2021 at 06:39:26PM -0400, Jeff King wrote:
Show 9 quoted lines
> It only becomes apparent with the second patch. I would have found it
> much easier to understand with something like the patch below. And then
> a further patch to use strvec_pushv instead of manually looping (even
> getting rid of the argc parameters entirely!), and one to convert
> run_file_diff() to use a struct child_process (which fixes its memory
> leak).
> 
> -- >8 --
> difftool: prepare "diff" cmdline in cmd_difftool()

Note that this actually introduces a new leak of the strvec in the caller. So it would probably want the "ret =" think I suggested to be squashed in.

(I wasn't really planning to make a finished patch, but just trying to illustrate what had confused me in your original. I ended up closer than I had planned, though).

-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 4 of 17 in “parse-options.c: remove OPT_ARGUMENT”
  1. 0/2 parse-options.c: remove OPT_ARGUMENTÆvar Arnfjörð Bjarmason, Sep 11, 2021
  2. 1/2 difftool: use "struct strvec" API in run_{dir,file}_diff()Ævar Arnfjörð Bjarmason, Sep 11, 2021
  3. Jeff KingSep 12, 2021
  4. Jeff KingSep 12, 2021
  5. Junio C HamanoSep 13, 2021
  6. 2/2 parse-options API: remove OPTION_ARGUMENT featureÆvar Arnfjörð Bjarmason, Sep 11, 2021
  7. Jeff KingSep 12, 2021
  8. 0/4 difftool refactoring + remove OPT_ARGUMENT() macroÆvar Arnfjörð Bjarmason, Sep 13, 2021
  9. 2/4 difftool: prepare "diff" cmdline in cmd_difftool()Ævar Arnfjörð Bjarmason, Sep 13, 2021
  10. 1/4 difftool: prepare "struct child_process" in cmd_difftool()Ævar Arnfjörð Bjarmason, Sep 13, 2021
  11. 3/4 difftool: use run_command() API in run_file_diff()Ævar Arnfjörð Bjarmason, Sep 13, 2021
  12. Jeff KingSep 13, 2021
  13. Ævar Arnfjörð BjarmasonSep 13, 2021
  14. Jeff KingSep 13, 2021
  15. 4/4 parse-options API: remove OPTION_ARGUMENT featureÆvar Arnfjörð Bjarmason, Sep 13, 2021
  16. Junio C HamanoSep 13, 2021
  17. Jeff KingSep 13, 2021

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.