git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alydis <alydis@august8.net>
To: git <git@vger.kernel.org>
Subject: Generating patches/Cherry Picking for a large number of commits
Date: Fri, 28 Aug 2009 14:26:43 -0500	[thread overview]
Message-ID: <ae09c2a40908281226r744141bm3a5bf4161ddab3e7@mail.gmail.com> (raw)

Hi,

Newly converted git user here.  I've stopped working with Subversion
ever since working with the Linux kernel has introduced me to git, and
never looked back!

I am currently working on a project in which I'm trying to backport
the powerpc boot-wrapper and device tree handling from Linux 2.6.30
into Linux 2.6.21.  We have some third party vendor code that is not
ready for the (new) completely fair scheduler just yet.  Yet, our BSP
relies on cuImage and the DTS files.

The approach I'm taking is to try to cherry-pick any commits between
v2.6.21 and v2.6.30 on the Linux kernel git repository that touch any
file in the arch/powerpc/boot directory into a v2.6.21 branch (and
pray that the conflicts are manageable).

I've tried something along these lines:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
cd linux-2.6
git checkout -b mybranch v2.6.21
git format-patch -o patches v2.6.21..v2.6.30 arch/powerpc/boot
git am -3 patches/*

But, to my dismay, format-patch here tears apart the commits and
applies ONLY the hunks that apply to the arch/powerpc/boot directory.
What I'd much rather do is obtain a list of commits that apply to
arch/powerpc/boot; but, then apply the entire patch.

I'm a bit lost at how to proceed at this point?  Do I need to write my
own script that uses git-log to grab the commit hashes that I want,
then call format-patch (or diff/apply/etc) individually on each of
them?  I realize I'll have to handle patch numbering myself, if I were
to do that (luckily, I believe format-patch allows you to specify the
starting number).  I also know at some point, I'll have to drill down
into individual commits and do some more detailed cherry picking to
form the desired patch series.  This script seems like a good deal of
work for me... so before I go off and start it, I was wondering if the
git gurus have any clever solutions for me?

Thanks,
Tommy Wang

             reply	other threads:[~2009-08-28 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 19:26 Alydis [this message]
2009-08-28 19:45 ` Generating patches/Cherry Picking for a large number of commits Jeff King
2009-08-28 19:50   ` Alydis
2009-08-28 20:34     ` Jakub Narebski
2009-08-28 22:35       ` Junio C Hamano
2009-08-28 21:54     ` Jeff King
2009-08-28 22:31     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae09c2a40908281226r744141bm3a5bf4161ddab3e7@mail.gmail.com \
    --to=alydis@august8.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).