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
using patch -p0 < broken.patch but not with python-patch:
$ ./patch.py --debug broken.patch
DEBUG reading broken.patch
WARNING error: patch stream is incomplete!
DEBUG - 0 hunks for a.txt
DEBUG total files: 1 total hunks: 0
DEBUG normalize filenames
DEBUG patch type = plain
DEBUG source = a.txt
DEBUG target = b.txt
Traceback (most recent call last):
File "./patch.py", line 1193, in <module>
main()
File "./patch.py", line 1186, in main
patch.apply(options.strip, root=options.directory) or sys.exit(-1)
AttributeError: 'bool' object has no attribute 'apply'
To patch a.txt correctly using python-patch, one needs to provide the non-truncated patch file which contains the full three lines of context (with the last line consisting of a single trailing space):
Given
a.txt
:and
broken.patch
(note that it's missing the third line of context):one can get to
b.txt
:using
patch -p0 < broken.patch
but not with python-patch:To patch
a.txt
correctly using python-patch, one needs to provide the non-truncated patch file which contains the full three lines of context (with the last line consisting of a single trailing space):This can be a problem since
git
is commonly configured to remove "unnecessary trailing whitespace" via the following option in~/.gitconfig
:The text was updated successfully, but these errors were encountered: