git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: Finn Arne Gangstad <finnag@pvv.org>
Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>,
	"git@vger.kernel.org List" <git@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	mat <matthieu.stigler@gmail.com>,
	hasen j <hasan.aljudy@gmail.com>,
	Erik Faye-Lund <kusmabite@googlemail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Avery Pennarun <apenwarr@gmail.com>,
	Robert Buck <buck.robert.j@gmail.com>
Subject: Re: [PATCH/RFC v2 1/4] Add "core.eolStyle" variable to control end-of-line conversion
Date: Mon, 10 May 2010 17:46:55 +0400	[thread overview]
Message-ID: <20100510134655.GE14069@dpotapov.dyndns.org> (raw)
In-Reply-To: <20100510111438.GA15206@pvv.org>

On Mon, May 10, 2010 at 01:14:39PM +0200, Finn Arne Gangstad wrote:
> On Mon, May 10, 2010 at 12:13:58PM +0400, Dmitry Potapov wrote:
> > 
> > First of autocrlf is safe as it is implemented now.
> 
> No, it isn't. autocrlf as it is implemented now is destructive for any
> file that contains CRLF in the repo (it also gives dirty files after
> checkout and so on).

It may give dirty files in your working tree, but you do not lose any
information silently (as it happened with CVS), so it is safe in this
respect.

> 
> > I believe that the right solution is to be able to enable autocrlf but
> > only for those repositories that are marked as autocrlf compatible by
> > upstream.
> 
> Yes absolutely. But how do you tell autocrlf that the repository is
> compatible with it?  This is what is causing all the problems.

I suppose the original design assumption of autocrlf was that nearly all
repo should be compatible, because autocrlf is very good on detecting
text files. The problem with that is that many people want to store text
files with different endings, but they cannot be bothered to add a few
lines to .gitattributes. And while it is possible now to disable autocrlf
in any repo just by adding one line to .gitattributes:
* -crlf
but it is impossible to say the opposite.

So, I believe we should add "crlf=auto" as Eyvind proposed, as well as
to do eol conversion for files marked as "crlf" even if autocrlf is not
set as Linus suggested earlier. (Certainly, "eolconv" would be a better
name than "crlf", but maybe it is not the right time to replace it right
now).

> 
> Now, I propose to change autocrlf in such a way that it will work as
> before for all repositories that are "compatible with it", but _also_
> so that it works reasonably with those that aren't.

No, you proposed something different. You said that conversion for new
files would become optional. I don't know what exactly you mean by
optional, but it sounds incompatible with what we have now. In fact,
what I really like about autocrlf is that I do not need to think about
when I add a new file.

Moreover, you said "Convert LF-only text files to CRLF on checkout",
which raises two questions:

1. Where should information about what file was and what was not
converted be stored? (Storying it in the index can make the index
incompatible with old versions of Git).

2. How does it solve the problem with new files? (Just saying that
this conversation will be optional, does not it mean that it will be
right for this particular repo.)



Dmitry

  reply	other threads:[~2010-05-10 13:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-08 21:46 [PATCH/RFC v2 0/4] End-of-line normalization, take 2 (now only slightly scary) Eyvind Bernhardsen
2010-05-08 21:46 ` [PATCH/RFC v2 1/4] Add "core.eolStyle" variable to control end-of-line conversion Eyvind Bernhardsen
2010-05-08 21:57   ` Linus Torvalds
2010-05-08 22:17     ` Eyvind Bernhardsen
2010-05-08 22:53       ` Eyvind Bernhardsen
2010-05-08 23:08         ` Linus Torvalds
2010-05-09  8:13           ` Eyvind Bernhardsen
2010-05-09 18:11             ` Linus Torvalds
2010-05-09 20:11               ` Eyvind Bernhardsen
2010-05-09  7:00         ` Dmitry Potapov
2010-05-09  7:30           ` hasen j
2010-05-10  7:16             ` Dmitry Potapov
2010-05-09  8:34           ` Eyvind Bernhardsen
2010-05-09 10:42           ` Eyvind Bernhardsen
2010-05-09 11:14             ` Robert Buck
2010-05-09 18:59               ` Eyvind Bernhardsen
2010-05-09 20:46                 ` Robert Buck
2010-05-10  4:33                   ` Eyvind Bernhardsen
2010-05-10 11:43                     ` Robert Buck
2010-05-10 13:25                       ` Robert Buck
2010-05-10 14:03                         ` Dmitry Potapov
2010-05-09 17:02             ` Jay Soffian
2010-05-09 17:43               ` Jay Soffian
2010-05-10 18:33               ` Eyvind Bernhardsen
2010-05-09 17:45             ` Junio C Hamano
2010-05-09 18:18               ` Finn Arne Gangstad
2010-05-09 21:57                 ` Junio C Hamano
2010-05-10  5:14                   ` Eyvind Bernhardsen
2010-05-09 20:25               ` Eyvind Bernhardsen
2010-05-09 20:09             ` Finn Arne Gangstad
2010-05-10  8:13               ` Dmitry Potapov
2010-05-10 11:14                 ` Finn Arne Gangstad
2010-05-10 13:46                   ` Dmitry Potapov [this message]
2010-05-09  9:21         ` Finn Arne Gangstad
2010-05-08 21:46 ` [PATCH/RFC v2 2/4] Add tests for per-repository eol normalization Eyvind Bernhardsen
2010-05-08 21:46 ` [PATCH/RFC v2 3/4] Pass eol conv mode as an argument instead of using global auto_crlf Eyvind Bernhardsen
2010-05-08 21:46 ` [PATCH/RFC v2 4/4] Add per-repository eol normalization Eyvind Bernhardsen

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

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

  git send-email \
    --in-reply-to=20100510134655.GE14069@dpotapov.dyndns.org \
    --to=dpotapov@gmail.com \
    --cc=apenwarr@gmail.com \
    --cc=buck.robert.j@gmail.com \
    --cc=eyvind.bernhardsen@gmail.com \
    --cc=finnag@pvv.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hasan.aljudy@gmail.com \
    --cc=kusmabite@googlemail.com \
    --cc=matthieu.stigler@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.
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 NNTP newsgroup(s).