Re: git on Cygwin: Not a valid object name HEAD
- From
Brian Downing <bdowning@lavos.net>
- Date
- Aug 7, 2007, 14:58 UTC
- Message-ID
- <20070807145825.GO21692@lavos.net>
- In-Reply-To
- <20070807143616.GO9527@spearce.org>
On Tue, Aug 07, 2007 at 10:36:16AM -0400, Shawn O. Pearce wrote:
Show 9 quoted lines
> Now on a normal UNIX system open(2) *always* by definition does > binary IO. But Cygwin's text mount option tries to make UNIX > programs DOS-friendly by making all files treated as text, even if > it supposedly doing binary IO via open(2). > > I think its a mis-feature of Cygwin. Git has no way (that I know > of) to defend itself from this, other than to tell the user to make > sure they only store a Git repository in a location that is mounted > with the binary flag.
Cygwin, like Windows' own open(2) simulation, defines an O_BINARY to pass as a flag to open(2). I once got Git half-working on Cygwin text-mode mounts by doing a horrible hack approximating:
#define open(name, flag, ...) \ open(name, (flag) | O_BINARY, ## __VA_ARGS__)
But it only half worked. Eventually it managed to corrupt itself again, and worse, the test suite was completely hopeless, as all shell activity still results in text-mode files.
-bcd