I'd like to interactively stage hunks of files in my working dir to my index, but the Chromium repo apparently has too many files:
$ git add -p .
Can't exec "git": Argument list too long at /usr/lib/git-core/git-add--interactive line 184.
Died at /usr/lib/git-core/git-add--interactive line 184.
In general, git add -p <pathspec> only seems to work when the paths contain a smalllll subset of files, and even then it can hang for a long time.
git add -p (without the pathspec) is much faster, but ignores newly created (untracked) files.
I found two possible solutions. One, you can interactively run patch and add untracked files:
This doesn't let you edit untracked files though, you have to stage the entire file.
Two, you can stage the untracked files as empty files, then enter patch mode:
$ git add --intent-to-add . # track all newly created files
$ git add -p # interactive patch mode, including newly tracked files
Seems to do everything I want, so partly I'm sending this to document my solution (can't find it elsewhere).
But is there a better fix for the root issue of "my repo is too big for command line calls"?