git usage question
Daniel P. Berrange
berrange at redhat.com
Wed Sep 8 09:09:57 UTC 2010
On Wed, Sep 08, 2010 at 10:02:27AM +0100, Richard W.M. Jones wrote:
> On Wed, Sep 08, 2010 at 10:44:27AM +0200, Andreas Schwab wrote:
> > "Richard W.M. Jones" <rjones at redhat.com> writes:
> > > For libguestfs I'm doing it manually. I have my own git repo which is
> > > a clone of the upstream libguestfs git repo. In that git repo I have
> > > the base stable version (eg. 1.4.3) plus cherry-picked patches on top
> > > of that. I use 'git rebase' when a new stable version comes out, and
> > > 'git format-patch' to generate the actual patches which go into Fedora
> > > git. At the moment I hand-edit the spec file to update the list of
> > > patches, but eventually the plan would be to generate the list of
> > > patches in the spec file too.
> > glibc takes a slightly different approach. The fedora-specific changes
> > are maintained in a branch. When I prepare a new fedora build I merge
> > master into the fedora branch, run "make srpm" to build an srpm that
> > contains the fedora changes in a single patch, and "fedpkg import" it
> > into fedora git.
> Yes, there is the question about whether to squash the patches,
> either into a single patch, or into fewer logical changes.
> In libvirt & libguestfs we took the decision to keep a 1-1 mapping
> with upstream git patches. The advantage is it is easy to see if a
> particular commit has gone into the SRPM. The disadvantage is you end
> up with a lot of patches in the SRPM ... In libguestfs I have tried
> to reduce the problem by documenting what logical changes have been
> backported (where "logical change" ~~ "group of patches implementing a
> feature or fix").
When maintaining a proper GIT branch against upstream and cherry picking
patches, the fact that you might end up with 100's of patches is not
really a burden anymore. GIT does all the hardwork for you. You can
automate patchfile creation with git format-patch, and a simple script
can munge the RPM spec to add the neccessary Patch: & %patch lines
and %changelogs based off the GIT commit summary line for each patch.
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the devel