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
Daniel Barkalow <barkalow@iabervon.org>
Date
May 28, 2008, 20:06 UTC
Message-ID
<alpine.LNX.1.00.0805281455100.19665@iabervon.org>
In-Reply-To
<7vskw2tgu2.fsf@gitster.siamese.dyndns.org>
On Wed, 28 May 2008, Junio C Hamano wrote:
Show 20 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > Report a non-fatal error, mark in the index that that entry is not 
> > reflected in the working directory, and allow the user to manipulate it 
> > with commands that don't really need the working directory content.
> >
> > $ git checkout origin/master
> > Warning: couldn't create 't/t5100/nul' in your working directory; ignoring 
> > working directory for this filename.
> > $ git mv t/t5100/nul t/t5100/nul-plain
> > $ ls t/t5100/nul-plain
> > t/t5100/nul-plain
> >
> > The working directory doesn't really have to be absolutely vital to git's 
> > functioning (of course, the project you've checked out is going to have 
> > problems unless you fix things). In particular, it should be possible, on 
> > a machine with a broken filesystem, to modify a project that triggers the 
> > filesystem breakage to not trigger it,...
> 
> Now that is somebody who thinks before types.

Well, and I've got the background to know what's possible and how git can keep things straight.

Show 10 quoted lines
> Marking that the filesystem does not match what's in index is already
> done, so you could argue that an alternative would be not to stop in the
> middle of checkout_entry() loop and instead check out as much as we could,
> write out the index perhaps, and signal error, _AFTER_ updating everything
> else, including the HEAD.  We try to be atomic when able (e.g. on a broken
> patch, "apply" does not apply early half the patch and fail but rejects
> the whole thing), but checkout_entry() loop is not something you can
> sanely make atomic (it needs to first remove existing files and even
> directories before writing new files), so that alternative approach might
> be easier to work with.

Ah, yes, CE_VALID. But it doesn't quite work as well as I'd like, because it doesn't ignore fstat/readdir not finding anything on the filesystem, so it comes out looking deleted, at least if you're actually on Linux (with a hack in create_file to refuse to create certain filenames for testing).

Also "git mv CE_VALID-source dest" doesn't ignore the filesystem like it should (for this use, anyway). Perhaps we need an additional flag for "the filesystem is irrelevant for this entry".

> Care to follow it up with a patch?

Unfortunately, I don't think I'll have a chance for a while to actually work on git code. But if someone else (Avery?) wants to try it, I think giving a big warning, setting CE_VALID, and returning 0 in entry.c before the "unable to create file" message is the right thing to start with. And someone with Windows access should figure out what happens next.

I think the right test for this is if create_file() returns EEXIST, but readdir doesn't show anything. For that matter, it might be useful to have logic 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.

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C HamanoNext: Junio C Hamano
Message 34 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.