On Tue, Jan 6, 2015 at 3:33 AM, Nikita Popov <nikita....@gmail.com> wrote: > On Tue, Jan 6, 2015 at 12:26 PM, Derick Rethans <der...@php.net> wrote: > >> On Tue, 6 Jan 2015, Nikita Popov wrote: >> >> > On Mon, Jan 5, 2015 at 11:58 PM, Stanislav Malyshev <smalys...@gmail.com >> > >> > wrote: >> > >> > > The code in the PHP source repo has a lot of random dangling >> > > whitespace at the end of lines, which looks sloppy and produces some >> > > weird effects in diffs because some editors auto-clean it and some >> > > do not. I'd like to clean it up (it's easy to do automatically) in >> > > master, but this produces a big patch that may also create some >> > > conflicts with existing pull reqs (easily resolved, but still). So, >> > > I'd like to ask if there are any objections to such cleanup? If not, >> > > then I'll do it, probably next weekend. >> >> Don't do it for just master, it makes automatic merging possibly a pain. >> It should go to all "alive" branches, with properly merged up commits. >> >> > No objection to whitespace cleanup. iirc git even has options to >> > ignore whitespace changes on merge/rebase. >> > >> > It would be nice to also add a pre-commit hook stripping trailing >> > whitespace, to avoid this happening again. >> >> That would change a commit hash, or cause an extra commit. No thanks. >> > > This is not how pre-commit hooks work. > > If we only want to check (as opposed to automatically fix), it would be > enough to recommend enabling the default pre-commit hook in our git > guidelines.
Even better than a server side hook, far less intrusive and rejecting a commit when CS are broken before it even gets applied locally sounds like the best solution so far. For the reference, how to make it: http://lostechies.com/jasonmeridth/2009/09/10/git-local-pre-commit-hook/ Now we only need a lint cmd call checking the PHP internals CS :) -- Pierre @pierrejoye | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php