Re: mingw, windows, crlf/lf, and git

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, February 13, 2007 - 9:52 am

On Tue, 13 Feb 2007, Johannes Schindelin wrote:

No no no.

It's going to be _horrible_ if people start interesting projects in 
Windows, and there are files in a git repository that are encoded with 
CRLF. 

I'd much rather just get this right, and that means "no hooks". If people 
start using commit hooks etc, that will just mean that they won't use them 
for all-windows environments (why use it? Everybody hass CRLF, and 
everybody _wants_ CRLF), or it will just be relatively expensive to have a 
complex hook anyway.

So I think we should plan on something like .gitattributes or similar, so 
that we _can_ handle mixed environments well, without any real setup or 
any real costs.

The costs really shouldn't be too high - we tend to avoid doing any 
expensive working tree changes *anyway*. For example, even "git checkout" 
has a huge optimization to avoid rewriting files that are already ok, so 
doing things like switching whole branches usually wouldn't even need any 
conversion for most files - even on platforms like Windows that need the 
conversion in the first place.

So considering that it looks _trivial_ for git-update-index, fairly easy 
for diff generation, and I doubt "git checkout" is really likely to be any 
worse either, this should just be somethign we do.

The *ONLY* case where we may not be able to do things automatically is 
actually a much more subtle one: "git cat-file". If we just get a SHA1, we 
don't know what the path to look it up was like, and thus we can never 
know whether it's a binary or a text object. With "-p" we can trivially 
guess, of course, but "git cat-file blob" simply must not do that!

But that really doesn't sound like a big problem to me ;)

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
mingw, windows, crlf/lf, and git, Mark Levedahl, (Sun Feb 11, 4:13 pm)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Sun Feb 11, 4:34 pm)
Re: mingw, windows, crlf/lf, and git, Robin Rosenberg, (Sun Feb 11, 5:14 pm)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Sun Feb 11, 7:37 pm)
Re: mingw, windows, crlf/lf, and git, Theodore Tso, (Sun Feb 11, 9:24 pm)
Re: mingw, windows, crlf/lf, and git, David Lang, (Mon Feb 12, 12:28 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Mon Feb 12, 4:36 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Mon Feb 12, 10:20 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Mon Feb 12, 3:37 pm)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Mon Feb 12, 3:54 pm)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Mon Feb 12, 4:02 pm)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Mon Feb 12, 4:02 pm)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Mon Feb 12, 4:09 pm)
Re: mingw, windows, crlf/lf, and git, David Lang, (Mon Feb 12, 4:23 pm)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Mon Feb 12, 4:24 pm)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Mon Feb 12, 4:25 pm)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Mon Feb 12, 4:42 pm)
Re: mingw, windows, crlf/lf, and git, David Lang, (Mon Feb 12, 4:46 pm)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Mon Feb 12, 4:50 pm)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Mon Feb 12, 5:32 pm)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Mon Feb 12, 5:59 pm)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Mon Feb 12, 6:06 pm)
Re: mingw, windows, crlf/lf, and git, Shawn O. Pearce, (Mon Feb 12, 6:13 pm)
Re: mingw, windows, crlf/lf, and git, David Lang, (Mon Feb 12, 6:20 pm)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Mon Feb 12, 6:36 pm)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Mon Feb 12, 7:02 pm)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Mon Feb 12, 8:21 pm)
Re: mingw, windows, crlf/lf, and git, Alexander Litvinov, (Mon Feb 12, 8:32 pm)
Re: mingw, windows, crlf/lf, and git, Jeff King, (Mon Feb 12, 10:18 pm)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Mon Feb 12, 11:05 pm)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Tue Feb 13, 3:06 am)
Re: mingw, windows, crlf/lf, and git, Alexander Litvinov, (Tue Feb 13, 5:16 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Tue Feb 13, 5:37 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 9:52 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 10:23 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 10:23 am)
Re: mingw, windows, crlf/lf, and git, Nicolas Pitre, (Tue Feb 13, 10:25 am)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Tue Feb 13, 11:00 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Tue Feb 13, 11:04 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Tue Feb 13, 11:05 am)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Tue Feb 13, 11:11 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 11:39 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Tue Feb 13, 11:42 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 12:07 pm)
Re: mingw, windows, crlf/lf, and git, Sam Ravnborg, (Tue Feb 13, 1:42 pm)
Re: mingw, windows, crlf/lf, and git, Nicolas Pitre, (Tue Feb 13, 2:08 pm)
Re: mingw, windows, crlf/lf, and git, David Lang, (Tue Feb 13, 4:19 pm)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 4:28 pm)
Re: mingw, windows, crlf/lf, and git, Alexander Litvinov, (Tue Feb 13, 8:47 pm)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Tue Feb 13, 10:16 pm)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Tue Feb 13, 10:36 pm)
Re: mingw, windows, crlf/lf, and git, Sam Ravnborg, (Wed Feb 14, 1:41 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Wed Feb 14, 4:10 am)
Re: mingw, windows, crlf/lf, and git, Alexander Litvinov, (Wed Feb 14, 4:36 am)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Wed Feb 14, 7:26 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 8:44 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 8:51 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Wed Feb 14, 8:53 am)
Re: mingw, windows, crlf/lf, and git, Johannes Schindelin, (Wed Feb 14, 8:56 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 9:23 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 9:28 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 9:37 am)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Wed Feb 14, 9:39 am)
Re: mingw, windows, crlf/lf, and git, Sam Ravnborg, (Wed Feb 14, 9:47 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 10:01 am)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Wed Feb 14, 10:18 am)
Re: mingw, windows, crlf/lf, and git, Mark Levedahl, (Wed Feb 14, 10:28 am)
Re: mingw, windows, crlf/lf, and git, Junio C Hamano, (Wed Feb 14, 10:29 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 10:43 am)
Re: mingw, windows, crlf/lf, and git, Robin Rosenberg, (Wed Feb 14, 11:17 am)
Re: mingw, windows, crlf/lf, and git, Linus Torvalds, (Wed Feb 14, 11:31 am)
Re: mingw, windows, crlf/lf, and git, Robin Rosenberg, (Wed Feb 14, 1:24 pm)