Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Cleanup line endings #245

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Cleanup line endings #245

merged 1 commit into from
Oct 3, 2023

Conversation

numberZero
Copy link
Contributor

Fix #242.

Can be reproduced with the commands described in the commit message.
Can also be checked with git diff --ignore-space-at-eol.
git blame -w is also useful.

The exact commands to make this commit were:

git reset --hard origin/master
find -type f |  # list all regular files
  grep -E '\.(h|cpp|fsh|vsh|mm)|LICENSE$' |  # filter for text files
  xargs -n 1 -P $(nproc) sed -i 's:\s*$::'  # for each file, trim trailing whitespace including the CR
git commit -a
@numberZero
Copy link
Contributor Author

@sfan5 This is the first part of the wholesale cleanup.

Other PRs are likely easiest to rebase across this as patches as it’s easy to trim trailing whitespace from a patch.

@nerzhul nerzhul merged commit 9954667 into minetest:master Oct 3, 2023
10 of 14 checks passed
@nerzhul
Copy link
Member

nerzhul commented Oct 3, 2023

Thanks, merged, let's move forward on this topic

@sfan5
Copy link
Member

sfan5 commented Oct 3, 2023

Other PRs are likely easiest to rebase across this as patches as it’s easy to trim trailing whitespace from a patch.

Is there a convenient alternative? For example if I wanted to cherry-pick from the upstream commits.

grorp added a commit to grorp/irrlicht that referenced this pull request Oct 4, 2023
grorp added a commit to grorp/irrlicht that referenced this pull request Oct 4, 2023
@numberZero
Copy link
Contributor Author

Is there a convenient alternative? For example if I wanted to cherry-pick from the upstream commits.

Dunno. If the upstream is still SVN maybe git-svn offers something. Otherwise, git format-patch & git am (and after merging into Minetest, git apply --directory=lib/irrlichtmt)

@numberZero numberZero deleted the cleanup-line-endings branch October 4, 2023 18:47
@sfan5
Copy link
Member

sfan5 commented Oct 15, 2023

Here's what I'm using for cherry-picking now:

pick ()
{
	local rev=$1
	shift
	git format-patch --stdout -k "$rev^..$rev" | dos2unix | git am --reject -k "$@"
}

@SmallJoker

This comment was marked as resolved.

@SmallJoker SmallJoker mentioned this pull request Nov 16, 2023
3 tasks
@numberZero
Copy link
Contributor Author

@SmallJoker git show --ignore-space-at-eol 9954667
Also git show --stat 9954667 to make sure no non-text files were changed (the “filter for text files” step was there for a reason).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup line endings
4 participants