GNOME Bugzilla – Bug 719531
Gitg generated patch fails to apply
Last modified: 2015-08-08 09:33:20 UTC
I generated a patch which had a new image file new it along with some text changes to an existing file. Applying this patch again gave me: sindhu@arch ~/code/gnome/zenity/help/C (git)-[master] % git am ~/tmp/patches/Add-user-help-for---listen-bug-711396.patch Applying: Add user help for --listen, bug 711396 error: cannot apply binary patch to 'help/C/figures/zenity-notification-listen-screenshot.png' without full index line error: help/C/figures/zenity-notification-listen-screenshot.png: patch does not apply Patch failed at 0001 Add user help for --listen, bug 711396 The copy of the patch that failed is found in: /home/sindhu/code/gnome/zenity/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". The line of interest here is: error: cannot apply binary patch to 'help/C/figures/zenity-notification-listen-screenshot.png' without full index line I generated patch for same commit with `git am` and compared contents of both these patches (git am- generated and gitg-generated) and found that `git am` patch had the binary changes in full whereas gitg-generated patch did not. `git am` generated patch had http://fpaste.org/57629/13857106/ gitg generated patch had http://fpaste.org/57630/71065513/
For now, we should detect if a patch contains binary and alert the user that we don't support this yet. Afaik, libgit2 doesn't currently generate binary patches, so if we would want support for this, we would need to implement something ourselves.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.