Re: [PATCH v2 4/4] upload-archive: use start_command instead of fork
- From
Jeff King <peff@peff.net>
- Date
- Aug 3, 2011, 05:49 UTC
- Message-ID
- <20110803054958.GA7547@sigill.intra.peff.net>
- In-Reply-To
- <4E388A55.6080606@kdbg.org>
On Wed, Aug 03, 2011 at 01:37:57AM +0200, Johannes Sixt wrote:
Show 12 quoted lines
> Am 02.08.2011 20:13, schrieb Jeff King: > > Hmm. So it's not _just_ the pipe vs file thing. What's different about > > calling it from the shell, versus the way we call it from git-archive? > > When the parent process of an MSYS process is itself an MSYS process, > such as bash, then the child does not do its own > binary-mode-vs.-text-mode detection, but just uses whatever it is told > by the parent. This is achieved by MSYS's fork emulation. > > But if the parent is a regular Windows program, such as git(-archive), > then the autodection happens and file descriptors pointing to files are > put into text mode.
Yuck. Well, I guess that's not really an option, then. The pipe trick sounds like the sanest option (it would even be trivial to switch the default value to "gzip -cn | cat" on Windows, but I assume "cat" has the same problem).
Thanks for the explanation.
-Peff