Re: selective git-update-index per diff(1) chunks
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 1, 2006, 19:42 UTC
- Message-ID
- <Pine.LNX.4.63.0612012039530.28348@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <ekpm6i$s35$1@sea.gmane.org>
Hi,
On Fri, 1 Dec 2006, Anand Kumria wrote:
Show 20 quoted lines
> On Fri, 01 Dec 2006 03:38:13 -0800, Junio C Hamano wrote: > > > Peter Baumann <Peter.B.Baumann@stud.informatik.uni-erlangen.de> > > writes: > > > >> I don't think it belongs in the plumbing, the git-update-index but I > >> think something like this would be very usefull. > >> > >> AFAIR darcs has this functionality. It selectively ask for each hunk if > >> it should be commited. This would be awfull to have in git. > > > > I concur, on both counts. My own now-defunct Porcelain had the > > darcs style interactive hunk selection because it felt so > > useful (and sometimes it was). > > Is there a good receipe on how to do this? Everytime I do it, I try a > different method; since I'm testing out my understanding of things. > > It'd nice to have some of these "advanced receipes" that people often do > noted down somewhere.
Can't say anything about advanced recipes, but I use a poor-man's workflow:
$ git diff > a1.patch $ vi a1.patch <edit out what I want to _keep_> $ git apply -R < a1.patch <test & commit> $ git apply < a1.patch
Of course, you could write a little wrapper around it, even one which asks you which hunks you want to edit out. Should not be that hard...
Note that this is independent of the SCM you are using.
Ciao, Dscho