From: "Torsten Bögershausen" <tboegi@web.de>
To: Kirill Likhodedov <kirill.likhodedov@jetbrains.com>,
git <git@vger.kernel.org>
Cc: "Николай Чашников" <Nikolay.Chashnikov@jetbrains.com>
Subject: Re: How to have EOL=LF and keep binary files auto-detection?
Date: Mon, 25 Apr 2016 18:46:02 +0200 [thread overview]
Message-ID: <4501b117-09e9-d24c-e209-bda28059765a@web.de> (raw)
In-Reply-To: <3670335C-4938-4DCD-9B1D-6B4737CBE6C2@jetbrains.com>
On 25.04.16 16:11, Kirill Likhodedov wrote:
> Hi,
>
> I wonder if it is possible both to have LFs in all and only text files in working trees, and keep Git’s binary files auto-detection?
>
> To be more precise:
> * we want all text files to be checked out in LF;
> * we don’t want force people to set “core.autocrlf” to false, preferring to keep this configuration in .gitattributes;
> * we obviously don’t want binary files to be touched by eol-normalization;
> * we also don’t want to declare all possible patterns of binary files - Git is good enough in detecting them automatically.
>
> However, I’ve found no way to do so.
>
> If I declare `* eol=lf` in .gitattributes, it makes Git treat all files as text and thus convert CRLF to LF even in binary files. It is consistent with man, but a bit surprising to have e.g. a zip or png file modified in this way.
>
> One could expect `* text=auto eol=lf` to work the way we want, but unfortunately it doesn’t work either: “eol=lf” forces “text” on all files.
>
> Thanks a lot for your help!
> -- Kirill.
The short answer: Git doesn't currently do that.
The closest you can get, is to use
echo "* text=auto" >.gitattributes
and
git config core.eol lf
git config core.autocrlf false.
The longer answer is, that I am working on a patch to allow just
the combination of "* text=auto eol=lf" to work as you want it.
Which platform do you use ?
And (out of curiosity, why do you want text files with LF ?)
If you are willing to compile and install Git yourself,
you can use the branch here:
https://github.com/tboegi/git/commits/160421_0706_reliable_t0027_allow_TC_combined_ident_CRLF_v7
Feedback is welcome, if it works as expected.
next prev parent reply other threads:[~2016-04-25 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 14:11 How to have EOL=LF and keep binary files auto-detection? Kirill Likhodedov
2016-04-25 16:46 ` Torsten Bögershausen [this message]
2016-04-26 15:31 ` Nikolay Chashnikov
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=4501b117-09e9-d24c-e209-bda28059765a@web.de \
--to=tboegi@web.de \
--cc=Nikolay.Chashnikov@jetbrains.com \
--cc=git@vger.kernel.org \
--cc=kirill.likhodedov@jetbrains.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).