Re: two git-cherry-pick enhancements
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 22, 2008, 09:29 UTC
- Message-ID
- <alpine.DEB.1.00.0805221026140.30431@racer>
- In-Reply-To
- <20080521163817.GA13124@denkbrett.schottelius.org>
Hi,
On Wed, 21 May 2008, Nico -telmich- Schottelius wrote:
Show 13 quoted lines
> When using git-cherry-pick there are two things missing for me and just > wondered how you see it (or maybe have a good solution): > > - Apply only parts of the patch which applies to <file ...>: > I sometimes want to apply patches only to some, but not all > files the patch introduces > > - Interactively selecting which parts to apply: > I want only 7 out of 10 changes the patch introduces. > It would help alot, if I could choose which parts I want > to apply for every part of the patch. > > Anything planned like that or did I oversee the right way?
Conceptually, this is really not cherry-picking _commits_. For example, the commit message will typically be all wrong if you pick only one change. Also, if I were the author of the original patch, I would not be happy for you to label me author of the cut-down (and possibly invalid) commit.
Therefore I suggest (just like on IRC the other day):
git show <commit> -- <file(s)> | git apply
possibly followed by
git add -i
or
git add -p <file>
Hth, Dscho