git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Dennis van der Wal <d.vanderwal@comparegroup.eu>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Git line ending trouble
Date: Mon, 14 Oct 2013 11:21:47 +0000	[thread overview]
Message-ID: <CE8193B5.3913E%d.vanderwal@comparegroup.eu> (raw)

Hello everyone,

Recently we have migrated from Subversion to Git in a multiplatform,
though mostly Windows oriented working environment. During the course of
this migration we ran into newline issues between people using Mac and
Windows. When investigating the issue we noticed that the migration
process had created many entries in the .gitattributes like "path/to/file
-text", explaining the problem.

To fix this problem we tried cleaning up the .gitattributes file and then
re-adding the files to Git so they would be stored with LF type line
endings (https://help.github.com/articles/dealing-with-line-endings). This
seemed to work until I noticed some weird behaviour, namely that whenever
I executed the aforementioned steps the number of files changed would
differ.

To verify this observation I tried the following experiment. I cloned one
of the migrated repositories 4 times, each of them cloned cleanly into a
different directory. Then for each, on master, I executed the following
commands:
  echo "* text=auto" > .gitattributes
  git add .
  git commit -m "Create basic .gitattributes file."
  git rm -r --cached .
  git reset --hard
  git add .
  git commit -m "Normalise line endings."
Note that the .gitattributes used to consist of one line "* text=auto
!eol" and many of the "path/to/file -text" entries I mentioned before, but
now has all content replaced with "* text=auto".

Each time the second commit command yielded a different result, ranging
from 0 files changed to 738 files changed and most of them hovering around
the 500+ mark. I tried with both version 1.7.12.4 and 1.8.4 on Mac OSX
Mountain Lion (10.8.5).

So my question to this mailing list is: Is this deviation in number of
files changed a known problem and if so is there a known workaround? I
tried looking for this particular observation, but I found it hard to come
up with a search query describing this issue.

Sincerely,
Dennis van der Wal
Java Developer at Compare Group

                 reply	other threads:[~2013-10-14 11:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CE8193B5.3913E%d.vanderwal@comparegroup.eu \
    --to=d.vanderwal@comparegroup.eu \
    --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).