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

"git add -i" with path gives "Argument list too long"

From
Wincent Colaiuta <win@wincent.com>
Date
Mar 21, 2010, 20:52 UTC
Message-ID
<45CD9D1B-6774-46F2-A444-654B1DEF7F69@wincent.com>
Back in January I reported a wart in "git add -i" and discussion kind of petered out and I forgot about the bug until today when I ran into it again. Now I have a few more cycles to burn I have the time to sort it out.
Just to revise what was discussed back in January:
- my original report: http://lists-archives.org/git/708569-git-add-i-with-path-gives-argument-list-too-long.html
- quick and easy fix posted by Jeff King: http://lists-archives.org/git/708591-git-add-i-with-path-gives-argument-list-too-long.html
- notes on inconsistencies between "git add" and "git add -i" by Jeff king: http://lists-archives.org/git/708698-git-add-i-with-path-gives-argument-list-too-long.html
To summarize and expand a bit upon what Jeff noted in that last post:
  - given _tracked_ file "foo.c" and _untracked_ file "bar.c"
  - "git add '*.c'" ignores the tracked file and stages the untracked file
  - "git add -i '*.c'" ignores the untracked file and operates on the tracked file
So, I gather that we can agree that this behavior isn't right. Either we treat the arguments as pathspecs or we don't, but it doesn't seem right to do one thing for tracked files and another for untracked ones, and it seems especially wrong for the differential treatment to apply in one direction with "git add" and in the other with "git add -i".
So, as a first step I'd like to make some test cases to serve as a specification for what we want the desired behavior to be. I saw in one of the "what's cooking messages" in February that there was some changes cooking in the "cp/add-u-pathspec" topic, so I am not entirely clear on if there is consensus about the desired behaviour.
Before I run ahead and start writing test, do we have consensus?
(Will have to worry about the initial cause of my bug report -- the "argument list too long" error -- later on.)

Cheers, Wincent

Next: Jeff King
Message 1 of 5 in “"git add -i" with path gives "Argument list too long"”
  1. Wincent ColaiutaMar 21, 2010
  2. Jeff KingMar 22, 2010
  3. Junio C HamanoMar 22, 2010
  4. Jeff KingMar 22, 2010
  5. Junio C HamanoMar 22, 2010

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.