[statitsics] .gitattributes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[statitsics] .gitattributes

Alex Herbert
The recent PR to add a new module to statistics may have suffered from problems with converting line endings.

This can be solved by having Windows users run this (optionally with --global):

> git config core.autocrlf true

But a better fix [1] is to add a .gitattributes file [2] containing:

* text=auto

The fix then applies to anyone using the repo irrespective of their own git global config.

[1] https://www.edwardthomson.com/blog/git_for_windows_line_endings.html <https://www.edwardthomson.com/blog/git_for_windows_line_endings.html>
[2] https://git-scm.com/docs/gitattributes <https://git-scm.com/docs/gitattributes>

Any objections to modifying the repo to have this configuration file?

Alex

Reply | Threaded
Open this post in threaded view
|

Re: [statitsics] .gitattributes

Eric Barnhill
+1

Users should also beware that working on a repo in Windows in an IDE can
cause the file to take on a pile of Windows line endings which git then
pushes. This has happened to me elsewhere. Maybe this fix takes care of it.

On Fri, May 24, 2019, 00:28 Alex Herbert <[hidden email]> wrote:

> The recent PR to add a new module to statistics may have suffered from
> problems with converting line endings.
>
> This can be solved by having Windows users run this (optionally with
> --global):
>
> > git config core.autocrlf true
>
> But a better fix [1] is to add a .gitattributes file [2] containing:
>
> * text=auto
>
> The fix then applies to anyone using the repo irrespective of their own
> git global config.
>
> [1] https://www.edwardthomson.com/blog/git_for_windows_line_endings.html <
> https://www.edwardthomson.com/blog/git_for_windows_line_endings.html>
> [2] https://git-scm.com/docs/gitattributes <
> https://git-scm.com/docs/gitattributes>
>
> Any objections to modifying the repo to have this configuration file?
>
> Alex
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [statitsics] .gitattributes

Alex Herbert

On 24/05/2019 15:55, Eric Barnhill wrote:
> +1
>
> Users should also beware that working on a repo in Windows in an IDE can
> cause the file to take on a pile of Windows line endings which git then
> pushes. This has happened to me elsewhere. Maybe this fix takes care of it.

 From what I understand this should fix git pushing windows line endings
for anyone using it on windows.

Following the guidelines on the git documentation I tried this:

$ echo "* text=auto" >.gitattributes
$ git add --renormalize .
$ git status        # Show files that will be normalized
$ git commit -m "Introduce end-of-line normalization"

It finds 3 files that require normalisation:

         modified:   src/site/xdoc/download_statistics.xml
         modified:   src/site/xdoc/issue-tracking.xml
         modified:   src/site/xdoc/mail-lists.xml

So adding this change currently does not effect many files. I've created
a PR for this.

Alex


>
> On Fri, May 24, 2019, 00:28 Alex Herbert <[hidden email]> wrote:
>
>> The recent PR to add a new module to statistics may have suffered from
>> problems with converting line endings.
>>
>> This can be solved by having Windows users run this (optionally with
>> --global):
>>
>>> git config core.autocrlf true
>> But a better fix [1] is to add a .gitattributes file [2] containing:
>>
>> * text=auto
>>
>> The fix then applies to anyone using the repo irrespective of their own
>> git global config.
>>
>> [1] https://www.edwardthomson.com/blog/git_for_windows_line_endings.html <
>> https://www.edwardthomson.com/blog/git_for_windows_line_endings.html>
>> [2] https://git-scm.com/docs/gitattributes <
>> https://git-scm.com/docs/gitattributes>
>>
>> Any objections to modifying the repo to have this configuration file?
>>
>> Alex
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]