git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alexander <alexander.samoylov@gmail.com>
To: git@vger.kernel.org
Subject: BUG: Git checkout on Linux sets always CRLF regardless of core.eol
Date: Wed, 12 Jun 2019 12:48:00 +0200	[thread overview]
Message-ID: <CABcYkASFxTe7Sq278EqCT1hBQq4Sh47-emNPJcnhA6YWZf+uQg@mail.gmail.com> (raw)

Hello,

I am trying to checkout out various 3rd party Git projects on Linux
and build them.
Some of them have text files created under Windows with CRLF endings
and it is not under my responsibility to change it.

Thus I have to force LF line ending for Git checkout (regardless of
which line endings the files have in the repo). I use the following
settings for that:

$ git config --system -l | grep core
core.eol=lf
$ git config --global -l | grep core
core.eol=lf

However it does not work. The issue is reproduced pretty fine on
https://github.com/winlibs/libjpeg project. This project does not have
.gitattributes file, therefore I expect that global settings must be
enough to force LF, but I observe different behavior:

$ git clone https://github.com/winlibs/libjpeg; file libjpeg/libjpeg.map
Cloning into 'libjpeg'...
...
libjpeg/libjpeg.map: ASCII text, with CRLF line terminators
(not only libjpeg.map, but a lot of *.c files also have CRLF if you check it)

libjpeg is an opensource project, so anyone can reproduce this issue
on a Linux host.

This makes me think that this it is either a bug or not documented behavior.
I tried various combinations with core.eol, core.autocrlf and even
global /etc/gitattributes file - nothing can force checkout with LF!

Could you please confirm whether it is a bug and provide the clear way
to bypass it.

My Git client version: 2.17.1. Please, see also
stackoverflow.com/questions/56546220/git-checks-out-crlf-instead-of-lf-on-linux.

--
Best Regards,
Aleksandr Samoilov
Build & Integration Ingenieur
Compart AG, 71034 Böblingen

             reply	other threads:[~2019-06-12 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 10:48 Alexander [this message]
2019-06-12 20:02 ` BUG: Git checkout on Linux sets always CRLF regardless of core.eol Torsten Bögershausen

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=CABcYkASFxTe7Sq278EqCT1hBQq4Sh47-emNPJcnhA6YWZf+uQg@mail.gmail.com \
    --to=alexander.samoylov@gmail.com \
    --cc=git@vger.kernel.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).