Re: wrong handling of text git attribute leading to files incorrectly reported as modified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]