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

Re: [PATCH] git-add --interactive (wip)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 12, 2006, 22:15 UTC
Message-ID
<Pine.LNX.4.63.0612122311400.2807@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vwt4wpytm.fsf@assigned-by-dhcp.cox.net>
Hi,
On Tue, 12 Dec 2006, Junio C Hamano wrote:
Show 6 quoted lines
> I've updated my "git add --interactive" in 'pu' and it now knows how to 
> split a hunk into smaller pieces and recounting the diff offsets before 
> applying (Johannes pointed out that his partial commit script, entirely 
> written in bash using shell arrays, has a similar feature.  I guess I 
> should have stolen his code instead of lifting the logic from my own 
> abandoned porcelain).
Well, not completely true. I do not split hunks into subhunks.

Note that you _could_ split hunks at arbitrary lines; if it is a line common between the two files, it is easier though.

And you could not have ripped from my script: I make heavy use of bash arrays (in fact, I wrote this script partly to learn how to work with bash arrays). If I could think of a clean way to spawn processes piped into "less -FS" several times from a C program, I would already have rewritten it in C.

> So in short, I think per-hunk update-index is a cute hack and may be 
> useful in a narrow simple cases, but it would not be so useful in the 
> real life.

To the contrary! In spite of having written git-hunk-commit to please those poor souls coming from the darcs side, I already used it myself quite often! I think it is a killer feature.

Ciao, Dscho

Previous: Junio C HamanoNext: Andreas Ericsson
Message 13 of 20 in “Re: git-commit: select which files to commit while editing the commit message”
  1. Jakub NarebskiDec 8, 2006
  2. Luben TuikovDec 8, 2006
  3. Josef WeidendorferDec 8, 2006
  4. Seth FalconDec 8, 2006
  5. Jakub NarebskiDec 9, 2006
  6. Seth FalconDec 9, 2006
  7. Junio C HamanoDec 9, 2006
  8. Josef WeidendorferDec 10, 2006
  9. Junio C HamanoDec 10, 2006
  10. git-add --interactive (wip)Junio C Hamano, Dec 11, 2006
  11. Josef WeidendorferDec 11, 2006
  12. Junio C HamanoDec 12, 2006
  13. Johannes SchindelinDec 12, 2006
  14. Andreas EricssonDec 13, 2006
  15. Josef WeidendorferDec 13, 2006
  16. Junio C HamanoDec 13, 2006
  17. Johannes SchindelinDec 13, 2006
  18. Shawn PearceDec 13, 2006
  19. Johannes SchindelinDec 13, 2006
  20. Josef WeidendorferDec 13, 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.