Re: [RFC] git-format-patch options
- From
Andreas Ericsson <ae@op5.se>
- Date
- Nov 21, 2005, 17:59 UTC
- Message-ID
- <43820AF8.5060208@op5.se>
- In-Reply-To
- <20051121173603.73700.qmail@web31806.mail.mud.yahoo.com>
Luben Tuikov wrote:
Show 21 quoted lines
> --- Andreas Ericsson <ae@op5.se> wrote: > > >>Please don't. git-format-patch is generally used to send > > > Ok, so then when I want to extract a single commit into a patch in a patch format, I loosely do > (scripted): > > git-rev-list --pretty=raw --max-count=1 <commit-ish> > > Then I record the parent <parent> of the commit-ish and do: > > git-format-patch [output options] <parent>..<commit-ish> > > Which gives me the commit with id <commit-ish> as a > formatted patch. > > Is there an alernative to this, as opposed to the two > step procedure above? >
Here's how to automate it.
git format-patch $(git rev-list --max-count=2 <commit-ish> | tail -n 1)..<commit-ish>
Either way, you need to know <commit-ish>, but this format should be fairly easy to add to git-format-patch. If you do, please let the user specify the --max-count (but default to 1) so it can be used to extract a series of patches rather than just one.
-- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231