Created attachment 879856 [details] Try "git am" first in "%autosetup -S git" In Fedora packaging I often use patch files generated by "git format-patch". They are best applied using "git am", which preserves the authorship information and commit messages. Unfortunately "%autosetup -S git" does not use "git am" and loses the commit messages. For this reason I've been staying away from autosetup in %prep and calling sequences of git commands manually instead. It would be nice if autosetup preferred "git am" and only if that failed, it would fall back to "git apply". I found an earlier attempt to implement this feature, by Stanislav Ochotnický: https://bugzilla.redhat.com/show_bug.cgi?id=1059285#c2 That attempt however was buggy and was not pushed forward. Here is a new proposed patch. I've tested it on a package with a mixture of git-formatted and plain patches and they applied successfully.
I will consider a patch that adds an option to make %autosetup use "git am" (and require it works for all patches), but these "lets try this, oops didn't work, lets try something else" kind of patches will not be accepted. Consistency and predictability are more important than preserving original git commit information in rpmbuild context.
Created attachment 884001 [details] [PATCH] add support for "%autosetup -S git_am" Panu, thanks for the review. Here's a new patch that leaves the existing "%autosetup -S git" alone and adds a new variant: "%autosetup -S git_am"
Works for me. Applied upstream, thanks for the patch!
rpm-4.11.3-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/rpm-4.11.3-1.fc20
rpm-4.11.3-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/rpm-4.11.3-1.fc19
rpm-4.11.3-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
rpm-4.11.3-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.