Boost logo

Boost :

Subject: Re: [boost] [git] Line endings in bootstrap.bat on Windows
From: Björn Pollex (bjoern.pollex_at_[hidden])
Date: 2013-11-25 09:22:12


On Mon, Nov 25, 2013 at 2:40 AM, Gavin Lambert <gavinl_at_[hidden]>wrote:

> On 25/11/2013 14:07, Quoth Dave Abrahams:
>
> Björn Pollex <bjoern.pollex_at_[hidden]> writes:
>>
>> I just cloned the modularized Boost repository from Github [1]. Right
>>> after
>>> the clone is done, git status gives me a complete diff on bootstrap.bat
>>> (so
>>> probably line endings).
>>>
>>> I do have autocrlf = true in my system configuration, so this shouldn't
>>> be
>>> the problem, right?
>>>
>>
>> It very well might be the problem.
>>
>
> Provided that the backend repository uses LF line endings exclusively
> (which is the git-recommended style), autocrlf=true is the recommended
> setting on Windows and should not result in a diff being shown if the
> checkout was made with this setting in force. [1][2]
>
> You should only run into trouble if the repository is not LF-only or if
> your checkout contains mixed-EOL files, either from using editors that
> altered EOLs (which will be common on Windows if you don't have
> autocrlf=true) or from changing the autocrlf setting after checking out.
>
> If the conversion is not already normalising line endings to LFs, perhaps
> it should do so? (With some exceptions for test files specifically for
> specific EOL handling, if any.)
>
>
While setting autocrlf = false fixed the problem for bootstrap.bat, several
other files still show changes right after the clone. Here are the steps I
executed:

    git clone https://github.com/boostorg/boost.git
    git submodule init
    git submodule update

Now when I run git status, I get this output:

    git status

    # On branch master
    # Changes not staged for commit:
    # (use "git add <file>..." to update what will be committed)
    # (use "git checkout -- <file>..." to discard changes in working
directory)
    # (commit or discard the untracked or modified content in submodules)
    #
    # modified: libs/geometry (modified content)
    # modified: libs/interprocess (modified content)
    # modified: libs/intrusive (modified content)
    # modified: libs/multiprecision (modified content)
    # modified: libs/pool (modified content)
    #
    no changes added to commit (use "git add" and/or "git commit -a")

The files affected are:

    libs/geometry/example/ml02_distance_strategy.cpp
    libs/interprocess/proj/vc7ide/doc_managed_grow.vcproj
    libs/interprocess/proj/vc7ide/managed_shared_memory.vcproj
    libs/interprocess/proj/vc7ide/offset_ptr_test.vcproj
    libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj
    libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj
    libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj
    libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj
    libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj
    libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj
    libs/multiprecision/doc/floating_point_eg1.svg
    libs/multiprecision/doc/floating_point_eg2.svg
    libs/multiprecision/doc/floating_point_eg3.svg
    libs/pool/doc/images/mb1.svg
    libs/pool/doc/images/mb2.svg
    libs/pool/doc/images/mb3.svg
    libs/pool/doc/images/mb4.svg
    libs/pool/doc/images/pc1.svg
    libs/pool/doc/images/pc2.svg
    libs/pool/doc/images/pc3.svg
    libs/pool/doc/images/pc4.svg
    libs/pool/doc/images/pc5.svg

Except for geometry, all affected files are Visual Studio project files or
SVGs. What should be done about this? As far as I can see, these files
should not be modified by Git, because these types are explicitly set to
"text" in .gitattributes.

The same is also true for my previous problem with bootstrap.bat. It is
actually strange that changing my autocrlf setting fixed this problem,
because .gitattributes should overwrite that setting anyways.

Can someone explain this behavior and what I can do to get a clean clone?

Regards,

    Björn Pollex

> [1] https://help.github.com/articles/dealing-with-line-endings
> [2] http://git-scm.com/book/ch7-1.html#Formatting-and-Whitespace
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/
> mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk