Bug 1082038 - "%autosetup -S git" should use "git am" whenever possible
Summary: "%autosetup -S git" should use "git am" whenever possible
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-28 14:17 UTC by Michal Schmidt
Modified: 2014-10-04 03:26 UTC (History)
6 users (show)

Fixed In Version: rpm-4.11.3-1.fc20
Clone Of:
Environment:
Last Closed: 2014-04-08 13:05:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Try "git am" first in "%autosetup -S git" (1.79 KB, patch)
2014-03-28 14:17 UTC, Michal Schmidt
no flags Details | Diff
[PATCH] add support for "%autosetup -S git_am" (880 bytes, patch)
2014-04-08 12:12 UTC, Michal Schmidt
no flags Details | Diff

Description Michal Schmidt 2014-03-28 14:17:36 UTC
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.

Comment 1 Panu Matilainen 2014-04-08 10:05:03 UTC
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.

Comment 2 Michal Schmidt 2014-04-08 12:12:58 UTC
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"

Comment 3 Panu Matilainen 2014-04-08 13:05:37 UTC
Works for me. Applied upstream, thanks for the patch!

Comment 4 Fedora Update System 2014-09-08 06:56:25 UTC
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

Comment 5 Fedora Update System 2014-09-16 07:49:56 UTC
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

Comment 6 Fedora Update System 2014-09-19 09:58:39 UTC
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.

Comment 7 Fedora Update System 2014-10-04 03:26:58 UTC
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.


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