Skip to content

Commit

Permalink
Suggest how to fix whitespace issues in a commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarne committed Nov 21, 2014
1 parent 83db8a2 commit 206f252
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ before_install:
script:
- if git --no-pager grep --color -n --full-name ' $' -- \*.jl \*.scm \*.c \*.cpp \*.h; then
echo "Error trailing whitespace found in source file(s)";
echo "";
echo "This can often be fixed with:";
echo " git rebase --whitespace=fix HEAD~1";
echo "or";
echo " git rebase --whitespace=fix master";
echo "and then a forced push of the correct branch";
exit 1;
fi
- make $BUILDOPTS prefix=/tmp/julia install
Expand Down

4 comments on commit 206f252

@ivarne
Copy link
Member Author

@ivarne ivarne commented on 206f252 Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inspired by #9098 (comment)

@timholy @jakebolewski Is this OK?

@timholy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make it git rebase --whitespace=fix origin/master. That way, if folks happen to working on their local master branch (naughty, naughty), it will still work. You might also want to explain that 1 is for a single commit.

@vchuravy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also would be nice to have a readme section on github/git with tips like this and guidelines for PRs like "no merge commits please, and if you have some in your PR find out how to fix them here [1] and here [2]"

[1] http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
[2] http://git-scm.com/book/en/v2/Git-Branching-Rebasing

@ivarne
Copy link
Member Author

@ivarne ivarne commented on 206f252 Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vchuravy We have CONTRIBUTING.md, and github suggests that you read it when opening an issue or a PR.

It can definitely be extended with some policy about keeping pull requests rebased and up to date with master, and that we prefer contributors to amend corrections and squash commits unless multiple commits provide a nice separation of independent changes.

Please sign in to comment.