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

Re: Commit cce8d6fdb introduces file t/t5100/nul, git tree is now incompatible with Cygwin (and probably Windows)

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2008, 20:43 UTC
Message-ID
<7v7idetb1h.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0805281455100.19665@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> Ah, yes, CE_VALID. But it doesn't quite work as well as I'd like, because 

No, I do not think we should involve CE_VALID here. It means something completely different. What I meant was that through "git status" the user can tell there is an unexpected breakage in the work tree, _if_ we make checkout to finish with "best effort" (and still report an error).

> I think the right test for this is if create_file() returns EEXIST, but 
> readdir doesn't show anything.

I think relying on EEXIST is too specific for this particular breakage, even though such a test may catch it. A checkout may fail in the middle if a filesystem refuses to create a pathname that has certain characters in it (e.g. dosen't NTFS refuse a path with :|<"?*> in it, or is it just the Explorer UI layer rejecting them?), or perhaps one leading directory may be unwritable. We would want to catch and cope with such a brokage the same way.

The checkout "unpack-trees" codepath does:
 - Make sure things can be checked out safely with the internal data
   before doing anything to the filesystem, i.e. no lost local changes, no
   lost untracked files, etc.
 - For each path:
   - make room for it, removing directory at the place as necessary where
     a blob must sit and removing an existing blob as needed;
   - create a new file or symlink;

And currently I think we stop on any failure. The thing is, stopping on a failure during the internal checking is fine --- no external damage has been made yet. But once we started updating the work tree, we _are_ committed and not aborting in the middle for a single failure would be the saner thing to do. In addition, even after such a failure after we are committed, we probably should update the HEAD and the index.

"status" would then show the difference between what should have been checked out and what is. It might be enough to improve the issue of "git bisect hitting a checkout failure --- the work tree is half checked-out state, and the index, the HEAD, and the work tree are in a very inconsistent state".

We would probably signal such an error from git-checkout differently from an early refusal that does not do anything, to tell the callers, such as "git-bisect", that the checkout _has been_ already done, even though there may be breakages in the work tree.

> ... that notes the situation where you seem to have file A instead of 
> file B, but fstat("B") returns A's inode, and marks the index to say that 
> entry B is listed in the filesystem as A instead.

I personally do not think such auto-substution is a way to go --- what makes you trust inode information from such an untrustworthy filesystem that does not do what it was told to do? I suspect that stopping at the error site and not automatically making the damage yet larger by doing such magic would keep the recovery procedure simpler.

But I wouldn't keep people from experimenting. Perhaps the end result could be even readable and mergeable, although I am quite pessimistic.

Previous: Daniel BarkalowNext: Junio C Hamano
Message 35 of 42 in “Commit cce8d6fdb introduces file t/t5100/nul, git tree is now incompatible with Cygwin (and probably Windows)”
  1. Mark LevedahlMay 26, 2008
  2. Johannes SchindelinMay 26, 2008
  3. Mark LevedahlMay 26, 2008
  4. Johannes SchindelinMay 26, 2008
  5. Mark LevedahlMay 26, 2008
  6. Johannes SchindelinMay 26, 2008
  7. Johannes SchindelinMay 26, 2008
  8. Eric BlakeMay 27, 2008
  9. Junio C HamanoMay 28, 2008
  10. Wincent ColaiutaMay 28, 2008
  11. Lea WiemannMay 28, 2008
  12. Wincent ColaiutaMay 28, 2008
  13. Jakub NarebskiMay 28, 2008
  14. Johannes SchindelinMay 29, 2008
  15. Wincent ColaiutaMay 29, 2008
  16. Johannes SchindelinMay 29, 2008
  17. Wincent ColaiutaMay 29, 2008
  18. Steffen ProhaskaMay 31, 2008
  19. gitweb: Remove gitweb/test/ directoryJakub Narebski, May 31, 2008
  20. Wincent ColaiutaMay 31, 2008
  21. Johannes SchindelinMay 31, 2008
  22. Jakub NarebskiJun 1, 2008
  23. Kay SieversJun 1, 2008
  24. Wincent ColaiutaJun 1, 2008
  25. Junio C HamanoJun 1, 2008
  26. Jakub NarebskiJun 1, 2008
  27. Avery PennarunMay 28, 2008
  28. Junio C HamanoMay 28, 2008
  29. Sverre RabbelierMay 28, 2008
  30. Avery PennarunMay 28, 2008
  31. Junio C HamanoMay 28, 2008
  32. Daniel BarkalowMay 28, 2008
  33. Junio C HamanoMay 28, 2008
  34. Daniel BarkalowMay 28, 2008
  35. Junio C HamanoMay 28, 2008
  36. "git checkout -- paths..." should signal errorJunio C Hamano, May 28, 2008
  37. Marius Storm-OlsenMay 29, 2008
  38. Daniel BarkalowMay 29, 2008
  39. Daniel BarkalowMay 28, 2008
  40. Makefile: wt-status.h is also a lib headerJohannes Schindelin, May 26, 2008
  41. Junio C HamanoMay 26, 2008
  42. Johannes SchindelinMay 26, 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.