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

[Bug] git add -i fails in multiple ways prior to first commit.

From
RKRhodes, Kate <masukomi@gmail.com>
Date
Feb 12, 2008, 00:59 UTC
Message-ID
<C50196C5-B0C5-4536-AD4A-0F9C553782EE@gmail.com>
$ git init
$ touch foo.txt
$ git add foo.txt
$ git add -i
fatal: bad revision 'HEAD'
            staged     unstaged path
*** Commands ***
   1: [s]tatus	  2: [u]pdate	  3: [r]evert	  4: [a]dd untracked
   5: [p]atch	  6: [d]iff	  7: [q]uit	  8: [h]elp
What now>
* status fails to report the current status
* update fails to work at all
* revert fails to work (not that there should be anything to revert  
but it shouldn't return a "fatal: bad revision 'HEAD'" message.
* add untracked works
* patch works
* diff fails
* help returns instructions that are incorrect owing to the fact that  
half of the things don't work in this state.
* quit, thankfully, works. :)

Why this is important: git add's interactive mode is intended to make things easier, thus it stands to reason that people new to git are going to want to use it. Presenting them with so many broken commands so early on is, obviously, a really bad idea.

-masukomi
Next: Jeff King
Message 1 of 13 in “[Bug] git add -i fails in multiple ways prior to first commit.”
  1. Rhodes, KateFeb 12, 2008
  2. Jeff KingFeb 13, 2008
  3. Jakub NarebskiFeb 13, 2008
  4. Jeff KingFeb 13, 2008
  5. add--interactive: handle initial commit betterJeff King, Feb 13, 2008
  6. Jeff KingFeb 13, 2008
  7. Johannes SchindelinFeb 13, 2008
  8. Jakub NarebskiFeb 13, 2008
  9. Jeff KingFeb 13, 2008
  10. Johannes SchindelinFeb 13, 2008
  11. Johannes SchindelinFeb 13, 2008
  12. Junio C HamanoFeb 13, 2008
  13. Jeff KingFeb 13, 2008

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.