On 2026-07-20 Andreas Grünbacher <[email protected]> wrote:
> Am Mo., 20. Juli 2026 um 03:43 Uhr schrieb Collin Funk 
> <[email protected]>:
> > Andreas Metzler <[email protected]> writes:
> >
> > > GNU patch 2.8 cannot apply recursive normal-format diffs:
> > > ---------------------------

[...]
> > > ametzler@argenau:/tmp/reprod$ diff --recursive --new-file dira dirb > 
> > > diffexamle.diff
> > > ametzler@argenau:/tmp/reprod$ cat diffexamle.diff
> > > diff --recursive --new-file dira/file dirb/file
> > > 2c2
> > > < blah
> > > ---
> > >> blub

[...]
> > Thanks for the report. I am going to forward it to [email protected],
> > and close this as notabug in diffutils, which does not contain 'patch'.

> GNU patch doesn't recognize filenames in "diff" lines, and it never
> has. (The exception are lines starting with "diff --git", which are
> assumed to be well-structured.)

> We could fix that, but only at the risk of breaking existing patches
> that contain unexpected "diff" lines. I'm sure we'd have to support
> things like multiple filename quoting styles, for example. So unless
> an obvious need for this functionality can be demonstrated, I'm fairly
> reluctant to add support for it.

> Until then, just use unified or context format diffs instead.

Hello,
sorry for the misdirected report, I had the misconception that GNU patch
and diff were part of the same source and failed to doublecheck.

The patch(es) I tried to apply were historic ones which I cannot
regenerate with sane options as I only have the patches. Since there are
a limited number of them in my project I can get around with a mixture
of scripting and hand holding. Would it be possible to update the
documentation for patch and diff to spell out that "diff --recursive"
*without* e.g. -u cannot be used as input for GNU patch? (I thought I
had well hidden corruption in the patches.)

cu Andreas
-- 
"You people are noisy," Nia said.
I made the gesture of agreement.



Reply via email to