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

Re: Bug? Git checkout fails with a wrong error message

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 16, 2012, 19:17 UTC
Message-ID
<87r4yzzcci.fsf@thomas.inf.ethz.ch>
In-Reply-To
<4F14718B.80209@unclassified.de>
Yves Goergen <nospam.list@unclassified.de> writes:
Show 5 quoted lines
> It's getting more weird. I believe that (msys)Git doesn't really know
> how the filesystem on its operating system works. I have made some more
> changes now and want to commit them. TortoiseGit reports the files
> Form1.Designer.cs and Form1.designer.cs (note the case difference) as
> modified and ready to commit. How is that supposed to work?
Depends.

If you work together with developers who have a case-sensitive FS (such as Linux, or with the right options OS X), it's entirely possible that this file exists in both spellings within the repository.

Otherwise, because Git needs to have the ability to store such spellings, there are some ways of introducing them (e.g., git-update-index).

I suspect the adoption rate of TortoiseGit across this list is about 0%, partly because it is a Windows-only tool, partly because it was written almost entirely without interacting with the Git list. So speaking in TortoiseGit terms here will most likely get you nowhere.

> If the index is such a problem child, how can I safely delete it
> completely and maybe have it regenerated if Git can't live without it?

The index is not only, as its name might imply, a throw-away cache. It is also used as the area where you prepare the contents of the next commit, and thus might hold data you do not want to lose. Nevertheless, you can discard and reset it to the contents of HEAD with

  rm -f .git/index
  git reset
> Great, I have the same file with an equal name twice in my repository
> (with 'git ls-files').
> 
> How stupid! Git, go learn file names.
Please cut&paste (!) actual command invocations (!) and outputs.
To see why this is important, consider
  "I have the same file with an equal name twice in my repository"

Judging by how this thread is going, there are at least four ways this could be interpreted:

* You have the byte-for-byte identical file name listed twice in the
  index.  That would be a pretty bad bug.
* Ditto, but in a commit.
* You have two filenames in the index that differ only by case, which
  makes them identical to your OS.
* Ditto, but in a commit.
See what I mean?

So please, let's be precise. You could start by cut&pasting the outputs of the following commands:

  git ls-tree -r HEAD
  git ls-files --debug
  git status -s

Otherwise, you can keep throwing around fuzzy complaints all you want but nobody will be able to help you because we cannot determine the exact state that your repository is in.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Yves GoergenNext: Erik Faye-Lund
Message 12 of 27 in “Bug? Git checkout fails with a wrong error message”
  1. Yves GoergenJan 12, 2012
  2. Holger HellmuthJan 13, 2012
  3. Yves GoergenJan 13, 2012
  4. Holger HellmuthJan 13, 2012
  5. Yves GoergenJan 15, 2012
  6. Holger HellmuthJan 16, 2012
  7. Yves GoergenJan 16, 2012
  8. Jeff KingJan 16, 2012
  9. Yves GoergenJan 16, 2012
  10. Jeff KingJan 16, 2012
  11. Yves GoergenJan 17, 2012
  12. Thomas RastJan 16, 2012
  13. Erik Faye-LundJan 16, 2012
  14. Yves GoergenJan 16, 2012
  15. Bug! Git merge also fails with a wrong error messageYves Goergen, Jan 13, 2012
  16. Jeff KingJan 13, 2012
  17. Yves GoergenJan 13, 2012
  18. Jeff KingJan 13, 2012
  19. Yves GoergenJan 13, 2012
  20. Carlos Martín NietoJan 13, 2012
  21. Yves GoergenJan 13, 2012
  22. Jakub NarebskiJan 13, 2012
  23. Yves GoergenJan 15, 2012
  24. Jakub NarebskiJan 15, 2012
  25. Thomas RastJan 17, 2012
  26. Yves GoergenJan 17, 2012
  27. Thomas RastJan 19, 2012

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.