From: Gwyneth Morgan <gwymor@tilde.club>
To: Keith Thompson <Keith.S.Thompson@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug: With diff.noprefix=true, `git format-patch` creates a patch that `git am` rejects
Date: Sat, 8 Jan 2022 02:45:59 +0000 [thread overview]
Message-ID: <Ydj6aYySwK5qP/uo@tilde.club> (raw)
In-Reply-To: <CAAHpriMPdahH2xbrrQbeCJPYpLhr6tuvT6xsG3nACmskKF1v2w@mail.gmail.com>
On 2022-01-07 16:36:27-0800, Keith Thompson wrote:
> The details: I had this in my $HOME/.gitconfig:
>
> [diff]
> noprefix = true
>
> This caused `git format-patch` *not* to generate the `a/` and `b/`
> prefixes in the patch file. Setting "noprefix = false" works around
> the problem.
>
> Here are the first few lines of the resulting patch file:
> ===
> cat 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch,000
> >From f4a41189d86bc208a90e754387294b9c4c11cdfc Mon Sep 17 00:00:00 2001
> From: Keith Thompson <Keith.S.Thompson@gmail.com>
> Date: Wed, 5 Jan 2022 13:30:16 -0800
> Subject: [PATCH] Fix documented argv and envp params for posix_spawn
>
> ---
> newlib/libc/posix/posix_spawn.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git newlib/libc/posix/posix_spawn.c newlib/libc/posix/posix_spawn.c
> index 005471fde..85bfa6477 100644
> --- newlib/libc/posix/posix_spawn.c
> +++ newlib/libc/posix/posix_spawn.c
> ===
>
> Feeding this patch to `git am` caused it to strip the `newlib/`
> prefix from the file name. There doesn't seem to be a way to coax
> `git format-patch` to ignore the current diff.noprefix setting,
> or `git am` to tolerate the missing prefixes.
The -p<num> flag controls how many segments `git am` or `git apply`
removes. The default is -p1. `git am -p0` should apply the patch
correctly.
prev parent reply other threads:[~2022-01-08 2:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 0:36 Bug: With diff.noprefix=true, `git format-patch` creates a patch that `git am` rejects Keith Thompson
2022-01-08 2:45 ` Gwyneth Morgan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ydj6aYySwK5qP/uo@tilde.club \
--to=gwymor@tilde.club \
--cc=Keith.S.Thompson@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).