git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Anand KumriaNext: Sam Vilain
Message 5 of 12 in “selective git-update-index per diff(1) chunks”
  1. Alexey DobriyanDec 1, 2006
  2. Peter BaumannDec 1, 2006
  3. Junio C HamanoDec 1, 2006
  4. Anand KumriaDec 1, 2006
  5. Johannes SchindelinDec 1, 2006
  6. Sam VilainDec 2, 2006
  7. Linus TorvaldsDec 1, 2006
  8. Sven VerdoolaegeDec 4, 2006
  9. Jakub NarebskiDec 4, 2006
  10. Jakub NarebskiDec 4, 2006
  11. Sven VerdoolaegeDec 4, 2006
  12. Jakub NarebskiDec 4, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.