Re: Better suggestions when git-am(1) fails
- From
Jeff King <peff@peff.net>
- Date
- Mar 9, 2023, 06:06 UTC
- Message-ID
- <ZAl3bHB9zxjLITgf@coredump.intra.peff.net>
- In-Reply-To
- <ZAlPtxZ/0Z28r5tF@coredump.intra.peff.net>
On Wed, Mar 08, 2023 at 10:17:11PM -0500, Jeff King wrote:
Show 12 quoted lines
> On Wed, Mar 08, 2023 at 09:15:53PM +0100, Alejandro Colomar wrote: > > > I had the following error already a few times, when some contributors, > > for some reason unknown to me, remove the leading path components from > > the patch. > > The reason is probably that they have set diff.noprefix in their config, > and git-format-patch respects that. Which is arguably a bug. There's a > little discussion in this message, along with references to some > previous discussions: > > https://lore.kernel.org/git/ZAWnDUkgO5clf6qu@coredump.intra.peff.net/
So here's a patch series which I think should help with the sending side. Most of it is just filling in gaps in the code and tests for current features. Patch 4 is the actual change. Patch 5 adds an equivalent option just for format-patch. I'm not convinced anybody really wants it (which is why I split it out), but it's probably worth doing just in case.
[1/5]: diff: factor out src/dst prefix setup [2/5]: t4013: add tests for diff prefix options [3/5]: diff: add --default-prefix option [4/5]: format-patch: do not respect diff.noprefix [5/5]: format-patch: add format.noprefix option
Documentation/config/format.txt | 7 ++++++ Documentation/diff-options.txt | 5 ++++ builtin/log.c | 17 +++++++++++++ diff.c | 33 ++++++++++++++++++++++---- diff.h | 2 ++ t/t4013-diff-various.sh | 42 +++++++++++++++++++++++++++++++++ t/t4014-format-patch.sh | 16 +++++++++++++ 7 files changed, 117 insertions(+), 5 deletions(-)
-Peff