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

Re: [PATCH v3] merge-ll: expose revision names to custom drivers

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2024, 17:37 UTC
Message-ID
<xmqqsf2rgb39.fsf@gitster.g>
In-Reply-To
<82624802-aa7f-4856-b819-9a2990b25a69@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> Not part of this patch but I noticed that we're passing the filenames
> for '%A' etc. unquoted which is a bit scary.

May be scary but safe, as long as create_temp() gives a reasonable temporary filename. We pass ".merge_file_XXXXXX" to xmkstemp(), which calls into mkstemp(), which should give us a shell safe name?

It also should be a safe conversion to change strbuf_addstr() used for these three to sq_quote_buf(), as the string with these %[OAB] placeholders are passed to the shell that eats the quoting before invoking the end-user supplied external merge driver, which means the merge driver would not notice any difference.

Thanks for being careful ;-)
Previous: Phillip WoodNext: Phillip Wood
Message 11 of 15 in “merge-ll: expose revision names to custom drivers”
  1. merge-ll: expose revision names to custom driversAntonin Delpeuch via GitGitGadget, Jan 18, 2024
  2. Kristoffer HaugsbakkJan 18, 2024
  3. Antonin DelpeuchJan 18, 2024
  4. merge-ll: expose revision names to custom driversAntonin Delpeuch via GitGitGadget, Jan 18, 2024
  5. Junio C HamanoJan 18, 2024
  6. Antonin DelpeuchJan 18, 2024
  7. merge-ll: expose revision names to custom driversAntonin Delpeuch via GitGitGadget, Jan 18, 2024
  8. Antonin DelpeuchJan 19, 2024
  9. Junio C HamanoJan 20, 2024
  10. Phillip WoodJan 20, 2024
  11. Junio C HamanoJan 20, 2024
  12. Phillip WoodJan 20, 2024
  13. Junio C HamanoJan 20, 2024
  14. merge-ll: expose revision names to custom driversAntonin Delpeuch via GitGitGadget, Jan 24, 2024
  15. Junio C HamanoJan 24, 2024

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.