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

Re: [PATCH] apply: clarify "-p" documentation

From
Junio C Hamano <gitster@pobox.com>
Date
May 11, 2018, 03:34 UTC
Message-ID
<xmqqin7uhnma.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180510142924.GB25617@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 28 quoted lines
> How about this?
>
> -- >8 --
> Subject: [PATCH] apply: clarify "-p" documentation
>
> We're not really removing slashes, but slash-separated path
> components. Let's make that more clear.
>
> Reported-by: kelly elton <its.the.doc@gmail.com>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  Documentation/git-apply.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
> index 4ebc3d3271..c993fbf714 100644
> --- a/Documentation/git-apply.txt
> +++ b/Documentation/git-apply.txt
> @@ -113,8 +113,10 @@ explained for the configuration variable `core.quotePath` (see
>  linkgit:git-config[1]).
>  
>  -p<n>::
> -	Remove <n> leading slashes from traditional diff paths. The
> -	default is 1.
> +	Remove <n> leading path components (separated by slashes) from
> +	traditional diff paths. E.g., with `-p2`, a patch against
> +	`a/dir/file` will be applied directly to `file`. The default is
> +	1.
Thanks for an obvious improvement.  Will queue.
>  
>  -C<n>::
>  	Ensure at least <n> lines of surrounding context match before
Previous: Jeff King
Message 3 of 3 in “Confusing documentation for git apply -p<n>”
  1. kelly eltonApr 27, 2018
  2. apply: clarify "-p" documentationJeff King, May 10, 2018
  3. Junio C HamanoMay 11, 2018

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.