git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Steffen Prohaska <prohaska@zib.de>
To: Brian Downing <bdowning@lavos.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Mark Levedahl <mlevedahl@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Sebastian Schuberth <sschuberth@gmail.com>
Subject: Re: git on Cygwin: Not a valid object name HEAD
Date: Wed, 8 Aug 2007 07:46:18 +0200	[thread overview]
Message-ID: <11631546-D4E4-491A-8A12-98A42043C535@zib.de> (raw)
In-Reply-To: <20070808042513.GP21692@lavos.net>


On Aug 8, 2007, at 6:25 AM, Brian Downing wrote:

> On Wed, Aug 08, 2007 at 12:46:49AM +0200, Steffen Prohaska wrote:
>> I started to run the tests on cygwin in textmode. I chose the
>> following setup.
>
> In addition to all the other stuff discussed, I believe you also need
> to worry about the binaryness of stdin and stdout.
>
> Looking at:
>
> http://www.cygwin.com/cygwin-ug-net/using-textbinary.html
>
> I think this can be achieved by putting something like:
>
> 	setmode(0, O_BINARY);
> 	setmode(1, O_BINARY);
>
> at the start of git's main().

I agree. This is my understanding as well.

> When I was trying to get this to work, I did this as well as fixing up
> open() and fopen() calls as has already been discussed.  What got me
> to quit, however, was that I never found a decent way to make the Git
> shell scripts binary safe, and enough of the system was in shell as to
> make it pretty much useless for everyday use.

Did you find a way, maybe not as decent as you wished?


> Looking at the examples on the above page:
>
>     To illustrate the various rules, we provide scripts to delete  
> CRs from
>     files by using the tr program, which can only write to standard  
> output.
>     The script
>
>     #!/bin/sh
>     # Remove \r from the file given as argument
>     tr -d '\r' < "$1" > "$1".nocr
>
>     will not work on a text mounted systems because the \r will be
>     reintroduced on writing. However scripts such as
>
>     #!/bin/sh
>     # Remove \r from the file given as argument
>     tr -d '\r' | gzip | gunzip > "$1".nocr
>
>     work fine. In the first case (assuming the pipes are binary) we  
> rely
>     on gunzip to set its output to binary mode, possibly overriding  
> the
>     mode used by the shell.
>
> was all it took to convince me this was probably a fool's errand.

Yeah, it looks quite crazy. I started to search for an
option that would force the shell to provide redirection
in binary mode, overriding the standard rules. I found
the igncr option [1], which is not what I need. But
apparently there have been some efforts to deal with
line endings in bash beyond the cygwin standard rules.
Maybe there's a useful option that I haven't found yet.

[1] http://cygwin.com/ml/cygwin-announce/2007-01/msg00015.html


> I wound up fixing our software so it would build on a binary mount,
> which I decided was a much more sane solution.

Well, our software already builds and I was not even aware
that there is a problem with git on cygwin until I asked
more people to test it. I naively chose the default option
because I didn't have a reason to do otherwise. But
apparently there is an option, and people use this option.

My fear is that the first impression of git is too bad on
Windows if it can't handle textmode. I can't recommend it.
People will make me responsible for recommending them a
tool that only cause troubles or forces them to reconfigure
their cygwin, which worked for them for years. I even
remember that we had a policy to explicitly set cygwin
to textmode to avoid problems with cvs commits in combination
with Visual Studio 6.

	Steffen

  reply	other threads:[~2007-08-08  5:47 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07  9:02 git on Cygwin: Not a valid object name HEAD Sebastian Schuberth
2007-08-07 11:58 ` Johannes Schindelin
2007-08-07 12:13   ` Sebastian Schuberth
2007-08-07 13:18     ` Sebastian Schuberth
2007-08-07 14:36       ` Shawn O. Pearce
2007-08-07 14:58         ` Brian Downing
2007-08-07 15:27           ` Sebastian Schuberth
2007-08-07 17:11           ` Steffen Prohaska
2007-08-07 17:42             ` Mark Levedahl
2007-08-07 19:41               ` Steffen Prohaska
2007-08-07 21:44                 ` Linus Torvalds
2007-08-07 22:28                   ` Junio C Hamano
2007-08-08  3:47                     ` Linus Torvalds
2007-08-07 22:46                   ` Steffen Prohaska
2007-08-07 22:49                     ` [PATCH] cygwin: added fopen "b" and open O_BINARY to support cygwin's textmode Steffen Prohaska
2007-08-07 22:49                       ` [PATCH] tests: added d2u to have unix style testfiles even in textmode Steffen Prohaska
2007-08-08  3:03                         ` Linus Torvalds
2007-08-08  5:00                           ` Steffen Prohaska
2007-08-07 23:20                     ` git on Cygwin: Not a valid object name HEAD Steffen Prohaska
2007-08-08  4:25                     ` Brian Downing
2007-08-08  5:46                       ` Steffen Prohaska [this message]
2007-08-07 22:26                 ` Junio C Hamano
2007-08-08  7:55                   ` Sebastian Schuberth
2007-08-08 13:50                 ` Mark Levedahl
2007-08-08 15:51                   ` Steffen Prohaska
2007-08-08 16:41                     ` Mark Levedahl
2007-08-08 17:20                       ` Johannes Schindelin
2007-08-08 19:37                         ` Steffen Prohaska
2007-08-08 20:13                           ` Steffen Prohaska
2007-08-08 20:36                             ` Steffen Prohaska
2007-08-08 23:07                               ` Mark Levedahl
2007-08-09  4:59                                 ` Steffen Prohaska
2007-08-09  6:01                               ` Marius Storm-Olsen
2007-08-09  6:38                                 ` Steffen Prohaska
2007-08-09  6:47                                   ` Marius Storm-Olsen
2007-08-09  8:50                                 ` Johannes Schindelin
2007-08-09  9:00                                   ` Marius Storm-Olsen
2007-08-09 10:33                                     ` Steffen Prohaska
2007-08-08 21:30                           ` Johannes Schindelin
2007-08-09  6:20                             ` Steffen Prohaska
2007-08-10  6:07                               ` Torgil Svensson
2007-08-10  7:19                                 ` Steffen Prohaska
2007-08-10 10:30                                   ` Johannes Schindelin
2007-08-10 11:14                                     ` Steffen Prohaska
2007-08-10 22:31                                   ` Torgil Svensson
2007-08-11  0:43                                     ` Steffen Prohaska
2007-08-13 10:50                                       ` Johannes Schindelin
2007-08-15  0:04                                       ` Torgil Svensson
2007-08-15  5:22                                         ` Steffen Prohaska
2007-08-15  5:30                                           ` David Kastrup
2007-08-15  5:43                                             ` Steffen Prohaska
2007-08-15  6:59                                               ` David Kastrup
     [not found]                                               ` <86k5rx474o.fsf@lola.quinscape.zz>
2007-08-15  7:38                                                 ` Shawn O. Pearce
2007-08-15 12:42                                                   ` Mark Levedahl
2007-08-15 12:48                                                     ` Mark Levedahl
2007-08-15 13:06                                                       ` Steffen Prohaska
2007-08-16  0:27                                                         ` Mark Levedahl
2007-08-16  6:04                                                           ` Steffen Prohaska
2007-08-16 11:55                                                             ` Mark Levedahl
2007-08-07 15:29       ` Mark Levedahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11631546-D4E4-491A-8A12-98A42043C535@zib.de \
    --to=prohaska@zib.de \
    --cc=bdowning@lavos.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mlevedahl@gmail.com \
    --cc=spearce@spearce.org \
    --cc=sschuberth@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).