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

Re: Files that cannot be added to the index

From
Shaun Ruffell <sruffell@digium.com>
Date
Aug 27, 2011, 19:26 UTC
Message-ID
<20110827192655.GA14333@digium.com>
In-Reply-To
<20110827184009.GA12767@digium.com>
On Sat, Aug 27, 2011 at 01:40:09PM -0500, Shaun Ruffell wrote:
> 
> So, in summary, it looks like this is fixed.

Actually, after playing with it a little more on OSX, I think it was just operator error on my part and that, for this, the versions are behaving the same.

Adding a non-existent file produces an error:
  $ git add adjaskdj
  fatal: pathspec 'adjaskdj' did not match any files

Adding a file that is on the filesystem but only differs in case with a file in the index silently fails:

  $ mv Makefile makefile
  $ echo "hello" >> makefile
  $ git ls-files -m
  Makefile
  $ git add makefile
And then when you try to commit the file you just added it fails:
  $ git commit
  # On branch master
  # Changes not staged for commit:
  #   (use "git add <file>..." to update what will be committed)
  #   (use "git checkout -- <file>..." to discard changes in working directory)
  #
  #	modified:   Makefile
  #
  no changes added to commit (use "git add" and/or "git commit -a")

Adding a file that is in the index, but only differs by case with a file in the filesystem works:

  $ git add Makefile
  $ git commit -m "test"
  [master 8de0bd6] test
   1 files changed, 1 insertions(+), 0 deletions(-)
Previous: Shaun RuffellNext: seanh
Message 8 of 10 in “Files that cannot be added to the index”
  1. seanhAug 26, 2011
  2. Michael J GruberAug 26, 2011
  3. seanhAug 26, 2011
  4. Shaun RuffellAug 26, 2011
  5. Jeff KingAug 27, 2011
  6. seanhAug 27, 2011
  7. Shaun RuffellAug 27, 2011
  8. Shaun RuffellAug 27, 2011
  9. seanhAug 27, 2011
  10. seanhAug 27, 2011

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.