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

Re: git on Cygwin: Not a valid object name HEAD

From
Steffen Prohaska <prohaska@zib.de>
Date
Aug 7, 2007, 22:46 UTC
Message-ID
<A80CCC35-DE1E-4A0B-9144-A8165AF6C98A@zib.de>
In-Reply-To
<alpine.LFD.0.999.0708071439021.5037@woody.linux-foundation.org>
On Aug 7, 2007, at 11:44 PM, Linus Torvalds wrote:
Show 24 quoted lines
>
>
> On Tue, 7 Aug 2007, Steffen Prohaska wrote:
>>
>> Is there any chance that patches would be accepted that try to
>> do so? Even if they add "b" to fopen and O_BINARY to open, which
>> both are useless on Unix?
>
> I certainly don't think it would be wrong to add O_BINARY to the  
> open()
> parameters (and "b" to fopen() and friends), if it makes a difference.
>
> Add a
>
> 	#ifndef O_BINARY
> 	#define O_BINARY 0
> 	#endif
>
> and it should be harmless anywhere else.
>
> So if you're willing to test, and extend on this, maybe something like
> this gets you started (I think the main issue will be the object  
> files,
> no?)

I took a more radical approach and used a small script to add "b" to all calls to fopen and O_BINARY to all calls to open. O_BINARY is provided by the Makefile if not on cygwin. I don't think we need to differentiate between binary and textfiles. I'll send the patch shortly.

I started to run the tests on cygwin in textmode. I chose the following setup.

- cygwin is set to binmode, that is cygwin's git is working.
- I used git to cloned git to a Windows directory, say c:\git
   and compiled there. The Windows directory is mounted in binmode.
- For testing I 'mount' this directory in text mode, in my example
     cd /
     mkdir git-textmode
     mount --text 'c:\git' git-textmode

This setup allows you to work with git and test in the same working directory in textmode. You should double check in which of your directories you commit. Right now, committing in the textmode directory is only for the brave ones. 'git read-tree HEAD' in the binmode directory should help if you executed the wrong git in the wrong directory and your index got corrupted.

The first problems I ran into are pre-computed sha1's for the test cases. I started to add d2u to the test scripts to generate files with unix style line endings even if cygwin is in textmode. This is needed to match the expected results that come with the test files. I'll send the first changes in a second patch. The patch is only for illustrating the problem. It's not thought to be applied.

The tests are running. t0000-basic and t0010-racy-git pass. I'll send a testlog later. It's running inside a virtual machine on a laptop, so it may take some more time.

I suspect the tests will report a lot of errors. At least all tests that compare 'echo' output with precomputed sha1's or expected results that come with the tests should fail. I haven't fully understood the details of line conversion of cygwin. Some work may be needed to eliminate false fails from the tests, e.g. by adding 'd2u', and find the real problems.

I have no time to continue today.
	Steffen
Previous: Linus TorvaldsNext: Steffen Prohaska
Message 14 of 60 in “git on Cygwin: Not a valid object name HEAD”
  1. Sebastian SchuberthAug 7, 2007
  2. Johannes SchindelinAug 7, 2007
  3. Sebastian SchuberthAug 7, 2007
  4. Sebastian SchuberthAug 7, 2007
  5. Shawn O. PearceAug 7, 2007
  6. Brian DowningAug 7, 2007
  7. Sebastian SchuberthAug 7, 2007
  8. Steffen ProhaskaAug 7, 2007
  9. Mark LevedahlAug 7, 2007
  10. Steffen ProhaskaAug 7, 2007
  11. Linus TorvaldsAug 7, 2007
  12. Junio C HamanoAug 7, 2007
  13. Linus TorvaldsAug 8, 2007
  14. Steffen ProhaskaAug 7, 2007
  15. cygwin: added fopen "b" and open O_BINARY to support cygwin's textmodeSteffen Prohaska, Aug 7, 2007
  16. tests: added d2u to have unix style testfiles even in textmodeSteffen Prohaska, Aug 7, 2007
  17. Linus TorvaldsAug 8, 2007
  18. Steffen ProhaskaAug 8, 2007
  19. Steffen ProhaskaAug 7, 2007
  20. Brian DowningAug 8, 2007
  21. Steffen ProhaskaAug 8, 2007
  22. Junio C HamanoAug 7, 2007
  23. Sebastian SchuberthAug 8, 2007
  24. Mark LevedahlAug 8, 2007
  25. Steffen ProhaskaAug 8, 2007
  26. Mark LevedahlAug 8, 2007
  27. Johannes SchindelinAug 8, 2007
  28. Steffen ProhaskaAug 8, 2007
  29. Steffen ProhaskaAug 8, 2007
  30. Steffen ProhaskaAug 8, 2007
  31. Mark LevedahlAug 8, 2007
  32. Steffen ProhaskaAug 9, 2007
  33. Marius Storm-OlsenAug 9, 2007
  34. Steffen ProhaskaAug 9, 2007
  35. Marius Storm-OlsenAug 9, 2007
  36. Johannes SchindelinAug 9, 2007
  37. Marius Storm-OlsenAug 9, 2007
  38. Steffen ProhaskaAug 9, 2007
  39. Johannes SchindelinAug 8, 2007
  40. Steffen ProhaskaAug 9, 2007
  41. Torgil SvenssonAug 10, 2007
  42. Steffen ProhaskaAug 10, 2007
  43. Johannes SchindelinAug 10, 2007
  44. Steffen ProhaskaAug 10, 2007
  45. Torgil SvenssonAug 10, 2007
  46. Steffen ProhaskaAug 11, 2007
  47. Johannes SchindelinAug 13, 2007
  48. Torgil SvenssonAug 15, 2007
  49. Steffen ProhaskaAug 15, 2007
  50. David KastrupAug 15, 2007
  51. Steffen ProhaskaAug 15, 2007
  52. David KastrupAug 15, 2007
  53. Mark LevedahlAug 7, 2007
  54. Shawn O. PearceAug 15, 2007
  55. Mark LevedahlAug 15, 2007
  56. Mark LevedahlAug 15, 2007
  57. Steffen ProhaskaAug 15, 2007
  58. Mark LevedahlAug 16, 2007
  59. Steffen ProhaskaAug 16, 2007
  60. Mark LevedahlAug 16, 2007

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.