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

Small issue with "add untracked" option of 'git add -i'

From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Date
Jun 12, 2017, 14:33 UTC
Message-ID
<1497278015.7302.13.camel@gmail.com>
Hello all,

There seems to be a small issue with the output of the "add untracked" option of 'git add -i'. Consider the following scenario,

* A user makes a change to a tracked file
* His repo has a few untracked files which he has left it in that way
intentionally
* He chooses to use 'git add -i' to stage changes
* He chooses option 4, accidentally, instead of option 5. He is shown
the following menu,
Show 7 quoted lines
> *** Commands ***
>   1: status	  2: update	  3: revert	  4: add
> untracked
>   5: patch	  6: diff	  7: quit	  8: help
> What now> 4
>   1: test-file
> Add untracked>> 
* He exits by hitting return but he is shown this weird message found
below.
> No untracked files.
* He is surprised on seeing this.

Why is that message shown when "there are untracked files" but the user doesn't add them to the staging area ? If that message is relative to the staging area shouldn't it be made more explicit? Further in that case it doesn't seem to be consistent with the another output shown in the scenario in which the developer chooses the 'add untracked' option when he really doesn't have any untracked files in his working directory.

Show 7 quoted lines
> *** Commands ***
>   1: status	  2: update	  3: revert	  4: add
> untracked
>   5: patch	  6: diff	  7: quit	  8: help
> What now> 4
> No untracked files.
> 
-- 
Regards,
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Next: Junio C Hamano
Message 1 of 10 in “Small issue with "add untracked" option of 'git add -i'”
  1. Kaartic SivaraamJun 12, 2017
  2. Junio C HamanoJun 12, 2017
  3. Kaartic SivaraamJun 12, 2017
  4. Junio C HamanoJun 12, 2017
  5. Kaartic SivaraamJun 14, 2017
  6. Kaartic SivaraamJun 15, 2017
  7. Kaartic SivaraamJun 21, 2017
  8. Kevin DaudtJun 21, 2017
  9. Kaartic SivaraamJun 21, 2017
  10. Kaartic SivaraamJun 22, 2017

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.