Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path: Opt into automatic git newline normalization #3506

Merged
merged 1 commit into from May 31, 2020

Conversation

gwicke
Copy link
Contributor

@gwicke gwicke commented May 25, 2020

Avoid spurious diffs from inadvertent newline changes by letting git
normalize newlines in the path module as well, just as a list of other
modules including Draft already do.

This effectively standardizes all checked-in code to Unix newlines, but
checkouts might use CRLF if that is the user preference. Thanks to @vocx-fc
for pointing me to the existing .gitattributes setup in the discussion on #3496.

Thank you for creating a pull request to contribute to FreeCAD! To ease integration, please confirm the following:

  • Branch rebased on latest master git pull --rebase upstream master
  • Unit tests confirmed to pass by running ./bin/FreeCAD --run-test 0
  • Commit message is well-written
  • Commit message includes issue #<id> or fixes #<id> where <id> is the associated MantisBT issue id if one exists

And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.19 Changelog Forum Thread.


@gwicke
Copy link
Contributor Author

gwicke commented May 25, 2020

Downside of the normalization is that other outstanding PRs will initially conflict on those newline changes after this diff has landed. However, I believe git might help fix this up by automatically applying the normalization on rebase.

@gwicke
Copy link
Contributor Author

gwicke commented May 26, 2020

Rebased onto 30dcafc (current master).

Avoid spurious diffs from inadvertent newline changes by letting git
normalize newlines in the path module as well, just as a list of other
modules including Draft already do.

This effectively standardizes all checked-in code to Unix newlines, but
checkouts might use CRLF if that is the user preference.
@gwicke
Copy link
Contributor Author

gwicke commented May 31, 2020

Rebased the latest manually. Diff ignoring the whitespace changes:

git diff -b master
diff --git a/src/Mod/.gitattributes b/src/Mod/.gitattributes
index 4b723a0c4..52d7eefe6 100644
--- a/src/Mod/.gitattributes
+++ b/src/Mod/.gitattributes
@@ -77,6 +77,7 @@ JtReader    export-ignore
 # Fem/** -text
 # Material/** -text
 # OpenSCAD/** -text
+# Path/** -text
 # Show/** -text
 # Tux/** -text

@@ -97,7 +98,6 @@ Mesh/** -text
 MeshPart/** -text
 Part/** -text
 PartDesign/** -text
-Path/** -text
 Plot/** -text
 Points/** -text
 Raytracing/** -text

@sliptonic sliptonic merged commit 6f76db0 into FreeCAD:master May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants