You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using git it will become commonplace to have patches formatted with git diff or git format-patch and these prepend by default prefixes like a/ and b/ in front of the paths. A patch created by git diff and usable by git apply or by patch -p1 starts with a header like this:
As it turns out now I have to edit all patch files I receive from devs while trying to test their changes by hand to remove the prefixes or tell them to generate then with git diff --no-prefix which is very uncommon and nobody does this.
I would change the patching logic such that if it fails to apply the patch with -p0 also try again to apply it with -p1. Or maybe even the other way around and try -p1 first because most patches will now come straight out of git and will be of the -p1 type.
Also you should add the -t option for batch processing, so it outputs an error instead of trying to read user input from stdin.
The text was updated successfully, but these errors were encountered:
prof7bit
changed the title
allow patches with prefix a/ and b/ (also try using -p1 if -p0 fails)
allow patches with prefix a/ and b/ (try using -p1 if -p0 fails)
Sep 4, 2021
When using git it will become commonplace to have patches formatted with
git diff
orgit format-patch
and these prepend by default prefixes like a/ and b/ in front of the paths. A patch created bygit diff
and usable bygit apply
or bypatch -p1
starts with a header like this:while a patch acceptable by
patch -p0
(current only possibility in fpcupdeluxe) would need to start like this:As it turns out now I have to edit all patch files I receive from devs while trying to test their changes by hand to remove the prefixes or tell them to generate then with
git diff --no-prefix
which is very uncommon and nobody does this.I would change the patching logic such that if it fails to apply the patch with -p0 also try again to apply it with -p1. Or maybe even the other way around and try -p1 first because most patches will now come straight out of git and will be of the -p1 type.
Also you should add the -t option for batch processing, so it outputs an error instead of trying to read user input from stdin.
The text was updated successfully, but these errors were encountered: