All of lore.kernel.org
 help / color / mirror / Atom feed
From: Holger Hellmuth <hellmuth@ira.uka.de>
To: Frank Ammeter <git@ammeter.ch>
Cc: git@vger.kernel.org
Subject: Re: wrong handling of text git attribute leading to files incorrectly reported as modified
Date: Wed, 16 Apr 2014 19:03:29 +0200	[thread overview]
Message-ID: <534EB7E1.7060807@ira.uka.de> (raw)
In-Reply-To: <E8A9F28E-FF68-4899-B02C-DB7A2C66F38A@ammeter.ch>

Am 11.04.2014 22:20, schrieb Frank Ammeter:
> #!/bin/bash
> # creating a git repo "repo"
> rm -rf repo
> mkdir repo
> cd repo
> git init
> # committing gitattributes with text attribute set for all files
> echo "* text" > .gitattributes
> git add .gitattributes
> git commit -m "added .gitattributes"
> # add a file with CRLF line ending with text attribute unset
> echo -e "crlf\r" > crlffile
> echo "* -text" > .gitattributes
> git add crlffile
> git commit -m "added crlffile"
> git checkout .gitattributes
> # now "crlffile" shows as modified, even though it isn't.

It is. In the repository is stored a crlffile with \r in it which would 
be changed when you would do a commit (with your current gitattributes)

> # only way to resolve is to modify .gitattributes

No. This works too:

git add crlffile
git commit -m .    # practically removes the \r inside the repository
git status crlffile
#shows up clean

      parent reply	other threads:[~2014-04-16 16:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 20:20 wrong handling of text git attribute leading to files incorrectly reported as modified Frank Ammeter
2014-04-11 20:38 ` Torsten Bögershausen
2014-04-12 11:29   ` Frank Ammeter
2014-04-15 20:12     ` Brandon McCaig
2014-04-15 21:23       ` Junio C Hamano
2014-04-16 11:49         ` Frank Ammeter
2014-04-16 16:50           ` Junio C Hamano
2014-04-16 17:03 ` Holger Hellmuth [this message]

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=534EB7E1.7060807@ira.uka.de \
    --to=hellmuth@ira.uka.de \
    --cc=git@ammeter.ch \
    --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.