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

Re: git add -p with new file

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2016, 18:48 UTC
Message-ID
<xmqq7f734qe0.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20161213173341.wemlunlixdp6277h@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
>> I am also not really sure what problem this feature is trying to solve.
>> If the "problem"(?) is that it should act more like "git add" instead of
>> "git add -u", for whatever reason, this may be fine (but the
>> configuration option is a must-have then).
>
> I think the problem is just that "add -p" does not give the whole story
> of what you might want to do before making a commit.

The same is shared by "git diff [HEAD]", by the way. It is beyond me why people use "add -p", not "git diff [HEAD]", for the final sanity check before committing.

Perhaps the latter is not advertised well enough? "add -p" does not even page so it is not very useful way to check what is being added if you are adding a new file (unless you are doing a toy example to add a 7-line file).

Show 7 quoted lines
>> > I'd also probably add interactive.showUntracked to make the whole thing
>> > optional (but I think it would be OK to default it to on).
>> Hm, "interactive.showUntracked" is a confusing name because "git add -i"
>> (interactive) already handles untracked files.
>
> Sure, that was just meant for illustration. I agree there's probably a
> better name.

"interactive.*" is not a sensible hierarchy to use, because things other than "add" can go interactive.

addPatch.showUntracked?
Previous: Jeff KingNext: Jeff King
Message 12 of 17 in “git add -p with new file”
  1. ArielDec 7, 2016
  2. Duy NguyenDec 7, 2016
  3. ArielDec 9, 2016
  4. Stephan BeyerDec 12, 2016
  5. Jeff KingDec 9, 2016
  6. ArielDec 9, 2016
  7. Jeff KingDec 10, 2016
  8. Junio C HamanoDec 10, 2016
  9. Jeff KingDec 11, 2016
  10. Stephan BeyerDec 12, 2016
  11. Jeff KingDec 13, 2016
  12. Junio C HamanoDec 13, 2016
  13. Jeff KingDec 13, 2016
  14. Junio C HamanoDec 13, 2016
  15. git add -p with unmerged files (was: git add -p with new file)Stephan Beyer, Dec 13, 2016
  16. Jeff KingDec 13, 2016
  17. Junio C HamanoDec 13, 2016

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.