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

how to split a hunk

From
BLbill lam <cbill.lam@gmail.com>
Date
Oct 28, 2009, 02:21 UTC
Message-ID
<20091028022105.GE3938@debian.b2j>
There are occasions where diff of a file is
- aaaa
+ bbbb
+ cccc

I want to add lines bbbb and cccc as separated commits, but git-add -p seem cannot further split this hunk. Do I have no choice but to edit it by hand and commit the bbbb and then edit the file to add back the cccc?

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
Next: Geert Bosch
Message 1 of 5 in “how to split a hunk”
  1. bill lamOct 28, 2009
  2. Geert BoschOct 28, 2009
  3. bill lamOct 28, 2009
  4. Thomas RastOct 28, 2009
  5. bill lamOct 28, 2009

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.