git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: kusmabite@gmail.com
Cc: Git Mailing List <git@vger.kernel.org>,
	msysGit <msysgit@googlegroups.com>,
	eyvind.bernhardsen@gmail.com
Subject: Re: git-archive and core.eol
Date: Tue, 11 Jan 2011 20:24:24 +0100	[thread overview]
Message-ID: <4D2CAE68.3000908@lsrfire.ath.cx> (raw)
In-Reply-To: <AANLkTi=WyzVzPkhOAMC2A8Dd=Zj_P-7YMVP-GaUz0-Qm@mail.gmail.com>

Am 10.01.2011 14:00, schrieb Erik Faye-Lund:
> On Mon, Jan 10, 2011 at 1:11 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
>> test. So now I've got to figure out what is different between your
>> test and mine. Perhaps I misdiagnosed to begin with?
>>
> 
> No, it doesn't quite seem like I misdiagnosed, but your test had
> different expectations than I have after reading the documentation. I
> expected core.autocrlf=true + core.eol=lf to pretty much be identical
> to core.autocrlf=false, but only because LF->LF conversion is a NOP.
> 
> 'core.autocrlf' is documented as meaning the same as setting the
> 'text' attribute to 'auto' for all files, plus "files that contain
> CRLF in the repository will not be touched". I figured that last part
> shouldn't affect me as I only had LFs in the repository.
> 
> If I disable core.autocrlf, I get what I want (no matter what I set
> core.eol to, it seems). But I still don't understand WHY
> core.autocrlf=true + core.eol=lf outputs CRLF.
> 
> It seems to me that there's a big gap between what the documentation
> claims and what actually happens here.

Having stared a bit at the test results, I think you only need to accept
that setting core.autocrlf=true during output overrules any core.eol
setting and gives you CRLF line endings no matter what's in the repository.

core.autocrlf=input overrules core.eol, too, in that no output conversion
takes place, no matter what the latter is set to.

I don't know if this is intended or even useful -- I don't use the options
myself, so I don't grok the possible use cases.  Perhaps something like
this can help?  Or do we need code changes?


diff --git a/Documentation/config.txt b/Documentation/config.txt
index ff7c225..6082f77 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -202,7 +202,7 @@ core.eol::
 	'lf', 'crlf' and 'native', which uses the platform's native
 	line ending.  The default value is `native`.  See
 	linkgit:gitattributes[5] for more information on end-of-line
-	conversion.
+	conversion.  This variable is ignored if `core.autocrlf` is set.
 
 core.safecrlf::
 	If true, makes git check if converting `CRLF` is reversible when
@@ -257,7 +257,8 @@ core.autocrlf::
 	setting if you want to have `CRLF` line endings in your
 	working directory even though the repository does not have
 	normalized line endings.  This variable can be set to 'input',
-	in which case no output conversion is performed.
+	in which case no output conversion is performed.  This variable
+	overrules `core.eol`.
 
 core.symlinks::
 	If false, symbolic links are checked out as small plain files that

      reply	other threads:[~2011-01-11 19:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 22:32 git-archive and core.eol Erik Faye-Lund
2011-01-08 13:35 ` René Scharfe
2011-01-08 17:28   ` Erik Faye-Lund
2011-01-09 12:52     ` René Scharfe
2011-01-10 12:11       ` Erik Faye-Lund
2011-01-10 13:00         ` Erik Faye-Lund
2011-01-11 19:24           ` René Scharfe [this message]

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=4D2CAE68.3000908@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=eyvind.bernhardsen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    --cc=msysgit@googlegroups.com \
    /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).