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

Re: Please support add -p with a new file, to add only part of the file

From
Jeff King <peff@peff.net>
Date
Jan 10, 2012, 19:38 UTC
Message-ID
<20120110193857.GA19665@sigill.intra.peff.net>
In-Reply-To
<7vd3ar9wto.fsf@alter.siamese.dyndns.org>
On Tue, Jan 10, 2012 at 11:33:39AM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >> Even if you start with "add -N", there won't be individual "hunks" you can
> >> pick and choose from diffing emptiness and the whole new file, so you end
> >> up using "edit hunk" interface.
> >
> > I don't think the main impetus for this is that people necessarily want
> > to pick and choose hunks from added files.
> 
> Well, read the subject of your e-mail and tell me what it says ;-)
Heh. Oops.

Yes, I agree that "add -p" is not especially useful for that case, and the workflow I was describing is very different[1].

Sorry for the noise.
-Peff
[1] For the record, I _do_ find myself using "git add -N" so that new
    files can be part of my "git add -p" workflow. So that feature is
    working as intended. It would save me a little bit of effort,
    though, if I could tell git I also want to include untracked files
    during the "-p" session, and dispense with the earlier "add -N".
    I'd also find it useful to mark conflicts as resolved, but I think
    we discussed that once before and you brought up some ugly corner
    cases.
Previous: Junio C HamanoNext: Josh Triplett
Message 6 of 7 in “Re: Please support add -p with a new file, to add only part of the file”
  1. Jonathan NiederJan 9, 2012
  2. Thomas RastJan 10, 2012
  3. Junio C HamanoJan 10, 2012
  4. Jeff KingJan 10, 2012
  5. Junio C HamanoJan 10, 2012
  6. Jeff KingJan 10, 2012
  7. Josh TriplettJan 10, 2012

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.