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

Re: [PATCH v2] apply: normalize path in --directory argument

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 20, 2026, 20:26 UTC
Message-ID
<xmqqpl5zw48c.fsf@gitster.g>
In-Reply-To
<pull.2198.v2.git.git.1771373732749.gitgitgadget@gmail.com>
"Joaquim Rocha via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 16 quoted lines
> From: Joaquim Rocha <joaquim@amutable.com>
>
> When passing a relative path like --directory=./some/sub, the leading
> "./" caused apply to prepend it literally to patch filenames, resulting
> in an error (invalid path).
> There may be more cases like this where users pass some/./path to the
> directory which can easily be normalized to an acceptable path, so
> these changes try to normalize the path before using it.
>
> Signed-off-by: Joaquim Rocha <joaquim@amutable.com>
> ---
>     apply: strip ./ prefix from --directory argument
>     
>     Changes since v1:
>     
>      * Normalized the path as Patrick recommended
Sounds like a sensible direction to go.
Will queue.  Thanks.  (of course, further reviews welcome).
Previous: Joaquim Rocha via GitGitGadget
Message 7 of 7 in “apply: strip ./ prefix from --directory argument”
  1. apply: strip ./ prefix from --directory argumentJoaquim Rocha via GitGitGadget, Feb 13, 2026
  2. Patrick SteinhardtFeb 17, 2026
  3. Junio C HamanoFeb 17, 2026
  4. Patrick SteinhardtFeb 18, 2026
  5. Joaquim RochaFeb 18, 2026
  6. apply: normalize path in --directory argumentJoaquim Rocha via GitGitGadget, Feb 18, 2026
  7. Junio C HamanoFeb 20, 2026

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.