PR 2730, "Fix" line-endings

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
ezzieyguywuf
Posts: 636
Joined: Tue May 19, 2015 1:11 am

Re: PR 2730, "Fix" line-endings

Postby ezzieyguywuf » Wed Dec 04, 2019 5:55 pm

Latest PR closed. PR 2751.

Leaving that link here as a reference, as the script used may be helpful to people in the future.
wmayer wrote:
Wed Dec 04, 2019 9:36 am
git blame has the option -w
This is absolutely the best way to approach this problem: nicely done wmayer!
User avatar
sgrogan
Posts: 5475
Joined: Wed Oct 22, 2014 5:02 pm

Re: PR 2730, "Fix" line-endings

Postby sgrogan » Wed Dec 04, 2019 11:46 pm

ezzieyguywuf wrote:
Wed Dec 04, 2019 5:55 pm
This is absolutely the best way to approach this problem: nicely done wmayer!
Does anyone know what the github webgui uses? Or if can be configured to use the -w switch?
wmayer
Site Admin
Posts: 14999
Joined: Thu Feb 19, 2009 10:32 am

Re: PR 2730, "Fix" line-endings

Postby wmayer » Thu Dec 05, 2019 3:12 am

sgrogan wrote:
Wed Dec 04, 2019 11:46 pm
ezzieyguywuf wrote:
Wed Dec 04, 2019 5:55 pm
This is absolutely the best way to approach this problem: nicely done wmayer!
Does anyone know what the github webgui uses? Or if can be configured to use the -w switch?
I wonder about this too as that's the way I most often use to check changes.
ezzieyguywuf
Posts: 636
Joined: Tue May 19, 2015 1:11 am

Re: PR 2730, "Fix" line-endings

Postby ezzieyguywuf » Thu Dec 05, 2019 11:16 am

5C3A6409-C5FD-44B1-ACEB-A6E2EEBF7D48.png
5C3A6409-C5FD-44B1-ACEB-A6E2EEBF7D48.png (245.29 KiB) Viewed 193 times
Looks like it does not use the “-w”, though I’m not sure if it’s configurable.

here is a link
wmayer
Site Admin
Posts: 14999
Joined: Thu Feb 19, 2009 10:32 am

Re: PR 2730, "Fix" line-endings

Postby wmayer » Thu Dec 05, 2019 12:04 pm

I found the answer here: https://stackoverflow.com/questions/444 ... -on-github

To test:
A while ago I had one of these commits that changed the line-endings of a file git commit 71dae0e63
When you look at the changes then the file src/Mod/Import/Gui/AppImportGuiPy.cpp has many whitespace changes. If you follow the solution and add ?w=1 at the end of the url you will see that only a few lines have actually changed in that file.
ezzieyguywuf
Posts: 636
Joined: Tue May 19, 2015 1:11 am

Re: PR 2730, "Fix" line-endings

Postby ezzieyguywuf » Thu Dec 05, 2019 3:09 pm

wmayer wrote:
Thu Dec 05, 2019 12:04 pm
add ?w=1 at the end of the url
😍

@wmayer you’re on fire!

Edit:

Didn’t work for me for the blame link I posted above, on my phone...
wmayer
Site Admin
Posts: 14999
Joined: Thu Feb 19, 2009 10:32 am

Re: PR 2730, "Fix" line-endings

Postby wmayer » Thu Dec 05, 2019 3:58 pm

ezzieyguywuf wrote:
Thu Dec 05, 2019 3:09 pm
Edit:

Didn’t work for me for the blame link I posted above, on my phone...
Yes, this is true but when I go to your FEM branch and look at the changes of the first commit then all files are modified. When adding the suffix it shows for every file whitespace-only change

https://github.com/FreeCAD/FreeCAD/pull ... 80e708?w=1
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: PR 2730, "Fix" line-endings

Postby bernd » Fri Dec 06, 2019 7:03 am

get rid of line ending diffs in github by adding

wmayer wrote:
Thu Dec 05, 2019 3:58 pm
?w=1
at the end of the address is a very value finding :D


https://github.com/FreeCAD/FreeCAD/commit/14eb6869a9
vs.
https://github.com/FreeCAD/FreeCAD/comm ... 6869a9?w=1
User avatar
Kunda1
Posts: 5945
Joined: Thu Jan 05, 2017 9:03 pm

Re: PR 2730, "Fix" line-endings

Postby Kunda1 » Fri Dec 06, 2019 7:47 am

bernd wrote:
Fri Dec 06, 2019 7:03 am
get rid of line ending diffs in github by adding
wmayer wrote: ?w=1
https://github.com/FreeCAD/FreeCAD/commit/14eb6869a9
vs.
https://github.com/FreeCAD/FreeCAD/comm ... 6869a9?w=1
This is a valuable gem. Nice!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: PR 2730, "Fix" line-endings

Postby bernd » Fri Dec 06, 2019 7:58 am

https://github.com/FreeCAD/FreeCAD/pull/2757

some informations. I had trouble on interactive rebases if adding the gitattribute file and the normalizing is in sparate commits. Thus I put it into one commit. The PR as it is now is how I would like to merge it into master.

IMHO, After the merge we should wait some time how does it work out until we do think about further changes in this regard.

bernd