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.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: PR 2730, "Fix" line-endings

Post by ezzieyguywuf »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: PR 2730, "Fix" line-endings

Post by sgrogan »

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?
"fight the good fight"
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: PR 2730, "Fix" line-endings

Post by wmayer »

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: 656
Joined: Tue May 19, 2015 1:11 am

Re: PR 2730, "Fix" line-endings

Post by ezzieyguywuf »

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

here is a link
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: PR 2730, "Fix" line-endings

Post by wmayer »

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: 656
Joined: Tue May 19, 2015 1:11 am

Re: PR 2730, "Fix" line-endings

Post by ezzieyguywuf »

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
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: PR 2730, "Fix" line-endings

Post by wmayer »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: PR 2730, "Fix" line-endings

Post by bernd »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: PR 2730, "Fix" line-endings

Post by Kunda1 »

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!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: PR 2730, "Fix" line-endings

Post by bernd »

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
Post Reply