[Webkit-unassigned] [Bug 176991] New: Normalize line terminators in jsoncpp Visual Studio files
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 15 02:33:14 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=176991
Bug ID: 176991
Summary: Normalize line terminators in jsoncpp Visual Studio
files
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit Misc.
Assignee: webkit-unassigned at lists.webkit.org
Reporter: aboya at igalia.com
endings).
Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/makefiles/vs71/jsoncpp.sln
Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/makefiles/vs71/jsontest.vcproj
Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/makefiles/vs71/lib_json.vcproj
Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/makefiles/vs71/test_lib_json.vcproj
They shouldn't because of .gitattributes [1]:
*.vcproj eol=crlf
*.vsprops eol=crlf
*.sln eol=crlf
Since they are text files, they are supposed to be stored normalized in the git
database (stored with LF terminators). Every time they are checkout out they
are converted to CRLF line endings (because that's what Visual Studio likes
working with).
Those files are not normalized in the database, and git is trying to fix that,
which is why they are "modified" even though they look the same before and
after. They are the same in the file system, but there is a line-terminator
change in the database.
These modifications are incredibly annoying as fellow WebKittens may have
already noticed many times. They appear out of nowhere as git finds this
inconsistency and it's very hard to get git to forget them. We should please it
once and for all so that we can finally work in peace.
`git show <hash>:<file>` can be used to read the raw file from the database
without any terminators altered.
In order to fix the issue we must turn this:
> git show HEAD:Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/makefiles/vs71/jsoncpp.sln | file -
/dev/stdin: ASCII text, with CRLF line terminators
Into this:
> git show HEAD:Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/makefiles/vs71/jsoncpp.sln | file -
/dev/stdin: ASCII text
Thanks to osse from #git in Freenode who helped me to figure this out.
[1] If you read `man gitattributes` you will find the following:
text
This attribute enables and controls end-of-line normalization. When
a text file is normalized, its line endings are converted to LF in
the repository. To control what line ending style is used in the
working directory, use the eol attribute for a single file and the
core.eol configuration variable for all text files. [...]
[...]
eol
This attribute sets a specific line-ending style to be used in the
working directory. It enables end-of-line conversion without any
content checks, effectively setting the text attribute.
Set to string value "crlf"
This setting forces Git to normalize line endings for this file
on checkin and convert them to CRLF when the file is checked
out.
Set to string value "lf"
This setting forces Git to normalize line endings to LF on
checkin and prevents conversion to CRLF when the file is
checked out.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170915/164cc984/attachment.html>
More information about the webkit-unassigned
mailing list