git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: git@vger.kernel.org
Subject: Re: EOL handling (EGit/svn/Windows)
Date: Tue, 10 Feb 2015 11:52:39 +0100	[thread overview]
Message-ID: <CAA01CspP-C5ZVSR6Vyxe0X6UxpxGPwEM=P_7QwcfPFpUBGEzPQ@mail.gmail.com> (raw)
In-Reply-To: <54D99BED.8010005@web.de>

On Tue, Feb 10, 2015 at 6:49 AM, Torsten Bögershausen <tboegi@web.de> wrote:
> Which Git versions are you using ?

The one I'm testing currently:

git version 1.7.9 (cygwin)
git version 1.9.0.msysgit.0 (msys)
EGit from Eclipse Luna

Cygwin git is a bit old, as I see now. Will try to update later.


> How many people are there involved, how many on Windows, how many on Linux ?

Less than 10 actively, most on Windows.


> Do you want to commit to svn, or is this a one-time conversion ?

One-time.


> If it is a one-time conversion, and you continue to work in Git only,
> then the cleanest, most portable and future proof way is to use the
> .gitattributes file,

I'm not sure if EGit supports .gitattributes:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372


> add that to the repo, do the normalization  and push.
> A line like this:
> * text=auto
> is the easiest way.

I'm trying it.


> Have a look at
> https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
> take a tee or coffee, do some experiments first with a dummy repo,
> but all the client OS/Gits involved.

That's one step we did not do carefully enough :(


> Please let us know the result (or feel free to ask more questions)

For testing, I've converted all files to LF and commited it, also
added the .gitattribute file.

So far:
1. msysgit can't checkout a one file (saying filename too long, the
relative path has 215 bytes) - probably not related to EOL issue.
Cygwin git works ok. So I did not check how msysgit works yet.
2. maybe due to old cygwin git, I have a problem of not displaying
changes, if the changed line has LF eol (and the file was checked out
on Windows with CRLF eols). Will try later with newer git.
2a. EGit handles such files gracefuly, but OTOH if the file is simple
dos2unix'ed, it shows diffs showing all lines changed, and when you
commit the files, it will create empty commit.


$ git status
# On branch master
#
nothing to commit (working directory clean)

$ file master/settings.gradle
master/settings.gradle: ASCII text, with CRLF line terminators

$ dos2unix.exe master/settings.gradle
dos2unix: converting file master/settings.gradle to Unix format ...

$ git status
# On branch master
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   master/settings.gradle
#
no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
fatal: LF would be replaced by CRLF in master/settings.gradle

$ echo "hi" >> master/settings.gradle

$ file master/settings.gradle
master/settings.gradle: ASCII text

############### diff does not show changes! ###################
$ git diff
fatal: LF would be replaced by CRLF in master/settings.gradle

$ git diff -- master/settings.gradle
fatal: LF would be replaced by CRLF in master/settings.gradle

$ cat master/settings.gradle
[the changes are there]

$ unix2dos.exe master/settings.gradle
unix2dos: converting file master/settings.gradle to DOS format ...

$ git diff
diff --git a/master/settings.gradle b/master/settings.gradle
index a8d6609..7aa9e6b 100755
[changes are shown]

$ vim -b master/settings.gradle
[remove CR from the changed line]

$ git status
# On branch master
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   master/settings.gradle
#
no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
fatal: LF would be replaced by CRLF in master/settings.gradle



-- 
Piotr Krukowiecki

  reply	other threads:[~2015-02-10 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 22:22 EOL handling (EGit/svn/Windows) Piotr Krukowiecki
2015-02-10  5:49 ` Torsten Bögershausen
2015-02-10 10:52   ` Piotr Krukowiecki [this message]
2015-02-10 15:32     ` Torsten Bögershausen
2015-02-11 11:46       ` Piotr Krukowiecki
2015-02-11 15:51   ` Piotr Krukowiecki

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='CAA01CspP-C5ZVSR6Vyxe0X6UxpxGPwEM=P_7QwcfPFpUBGEzPQ@mail.gmail.com' \
    --to=piotr.krukowiecki@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    /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).