Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1057263 - git am fails to apply patch created by git format-patch
Summary: git am fails to apply patch created by git format-patch
Alias: None
Product: Fedora
Classification: Fedora
Component: git
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Chris Wright
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-01-23 17:45 UTC by Jakub Dorňák
Modified: 2014-02-03 09:58 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-02-03 09:58:48 UTC
ooprala: needinfo-

Attachments (Terms of Use)
product of git format-patch (deleted)
2014-01-23 17:45 UTC, Jakub Dorňák
no flags Details | Diff

Description Jakub Dorňák 2014-01-23 17:45:44 UTC
Created attachment 854515 [details]
product of git format-patch

Description of problem:
git am fails to apply patch created by git format-patch

Version-Release number of selected component (if applicable):

How reproducible:
in this particular case

Steps to Reproduce:
1. fedpkg clone mysql-connector-java; cd mysql-connector-java
2. git reset --hard 3850161f470bf7201adb63998350d1fc8ad21217
3. git am

Actual results:
[jdornak@colt ~/mysql-connector-java]$ git am
Applying: Update to 5.1.28, fix to also remove .zip files Resolves: #1049223
/home/jdornak/mysql-connector-java/.git/rebase-apply/patch:900: space before tab in indent.
 		// nothing to do here.
/home/jdornak/mysql-connector-java/.git/rebase-apply/patch:901: trailing whitespace.
/home/jdornak/mysql-connector-java/.git/rebase-apply/patch:1370: trailing whitespace.
/home/jdornak/mysql-connector-java/.git/rebase-apply/patch:1375: trailing whitespace.
/home/jdornak/mysql-connector-java/.git/rebase-apply/patch:1378: trailing whitespace.
      * @throws java.sql.SQLException If no object found that implements the interface 
error: patch failed: mysql-connector-java-jdbc-4.1.patch:279
error: mysql-connector-java-jdbc-4.1.patch: patch does not apply
Patch failed at 0001 Update to 5.1.28, fix to also remove .zip files Resolves: #1049223
The copy of the patch that failed is found in:
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".

Expected results:
Commit applied.

Additional info:
It is possible to apply the patch with command:
$ patch <
So it seems that the patch itself is OK.

Comment 1 Ondrej Oprala 2014-01-24 10:51:09 UTC
Although git-am uses the underlying git-apply, it seems to be a bit more strict than using git-apply directly. Anyway, git am --ignore-whitespace your.patch
worked for me.

Note You need to log in before you can comment on or make changes to this bug.