All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Boeckel <mathstuf@gmail.com>
To: git@vger.kernel.org
Subject: Cannot checkout after setting the eol attribute
Date: Tue, 22 Aug 2017 13:49:18 -0400	[thread overview]
Message-ID: <20170822174918.GA1005@megas.kitware.com> (raw)

Hi,

I specified the `eol` attribute on some files recently and the behavior
of Git is very strange.

Here is the set of commands to set up the repository used for the
discussion:

    git init
    echo $'dos\r' > dos
    git add dos
    git commit -m "dos newlines"
    echo "dos -crlf" > .gitattributes
    git add .gitattributes
    git commit -m "add attributes"
    echo "dos eol=crlf" > .gitattributes
    git add .gitattributes
    git commit -m "set eol attribute instead"

The following behaviors are observed:

  - `git reset --hard` does not make the working directory clean; and
  - `git rebase` gets *very* confused about the diffs in the working
    tree because `git stash` can't reset the working tree;

There are probably other oddities lingering about as well. If I commit
what Git thinks is the difference, the diff (with invisibles made
visible) is:

    % git diff | cat -A
    diff --git a/dos b/dos$
    index fde2310..4723a1b 100644$
    --- a/dos$
    +++ b/dos$
    @@ -1 +1 @@$
    -dos^M$
    +dos$

Seen in 2.9.5 and 2.14.0.rc1.

--Ben

             reply	other threads:[~2017-08-22 17:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 17:49 Ben Boeckel [this message]
2017-08-22 19:13 ` Cannot checkout after setting the eol attribute Torsten Bögershausen
2017-08-22 19:44   ` Ben Boeckel
2017-08-23 19:43     ` Torsten Bögershausen
2017-08-23 21:09       ` Ben Boeckel
2017-08-22 20:03   ` Junio C Hamano
2017-08-23 21:17 ` [PATCH] Documentation: mention that `eol` can change the dirty status of paths Ben Boeckel
2017-08-23 21:21   ` Ben Boeckel
2017-08-24  5:50   ` Torsten Bögershausen
2017-08-30 13:49     ` Ben Boeckel
2017-08-30 21:31     ` Junio C Hamano
2017-08-31 13:16       ` Ben Boeckel
2017-08-30 13:59 ` [PATCH v2] " Ben Boeckel
2017-08-31 13:19 ` [PATCH v3] " Ben Boeckel
2017-08-31 14:33   ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170822174918.GA1005@megas.kitware.com \
    --to=mathstuf@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.