From: Jakub Narebski Date: Fri, 28 Aug 2009 20:34:36 GMT Subject: Re: Generating patches/Cherry Picking for a large number of commits Message-ID: In-Reply-To: [Alydis, please do not toppost] Alydis writes: > On Fri, Aug 28, 2009 at 2:45 PM, Jeff King wrote: >> On Fri, Aug 28, 2009 at 02:26:43PM -0500, Alydis wrote: >> >>> I've tried something along these lines: >>> [...] >>> 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. >> >> By default, format-patch (and log, gitk, etc) when given a path limiter >> will also limit the diff shown. You can override it with --full-diff. > > Ack! Embarrassing RTFM. > > While I have your attention, however, I noticed that git am > will apply the list patches generated by format-patch. The > documentation said something about mbox/maildir directories, which I > actually am not that familiar with. Is it safe to say that git am > will read the path and apply patches in numerical order? git-format-patch | git-am pipeline has to work correctly, as it originally was the way (modulo extra options) git-rebase was implemented. So yes, "git am " should understand and apply in correct order result of "git format-patch -o ". > Does it allow skipping? There is "git am -i". -- Jakub Narebski Poland ShadeHawk on #git