Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80233 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55153 invoked from network); 6 Jan 2015 11:43:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2015 11:43:50 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.174 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.174 mail-qc0-f174.google.com Received: from [209.85.216.174] ([209.85.216.174:34457] helo=mail-qc0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/64-26786-57ACBA45 for ; Tue, 06 Jan 2015 06:43:49 -0500 Received: by mail-qc0-f174.google.com with SMTP id c9so16572562qcz.19 for ; Tue, 06 Jan 2015 03:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y8UxjHa4r01+cgANrMbXV4KuPuFcMUDSLtZcYTs+lTs=; b=dV5f8SdQ3RfBw8p5bHdal4UAA3d2bZzpnoiqeFVW7/L4gUP02CTAXiucY8/5CLRHbs NYPwaSc1P/LgSr6bd/9kwOtlKl5UrqboNZZZFIf9RA/oevURmwLDskw5boaIi0uwBhxy m7Xugpq+xFRDFpdD4syhJJ+YVW7rMbAh3K3J162eY/fHSk+qEJWhb58gvGX5DkwqP3PY mPi4siArti50cFnzVlIIDb27QTCK3LcjnzxVZy2drqf9Bd46lBNu0KBpciumf49OY/yK C4v5zmnPor1iumIhTJspjxcYda+fRP/nRJZgGw6kbhi9G35Ozn4Mp2mdCexOlvnQZUNy cdoA== MIME-Version: 1.0 X-Received: by 10.224.15.78 with SMTP id j14mr155106581qaa.0.1420544627394; Tue, 06 Jan 2015 03:43:47 -0800 (PST) Received: by 10.140.22.106 with HTTP; Tue, 6 Jan 2015 03:43:47 -0800 (PST) In-Reply-To: References: <54AB172E.6040901@gmail.com> Date: Tue, 6 Jan 2015 03:43:47 -0800 Message-ID: To: Nikita Popov Cc: Derick Rethans , Stanislav Malyshev , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Cleaning up dangling whitespace From: pierre.php@gmail.com (Pierre Joye) On Tue, Jan 6, 2015 at 3:33 AM, Nikita Popov wrote: > On Tue, Jan 6, 2015 at 12:26 PM, Derick Rethans wrote: > >> On Tue, 6 Jan 2015, Nikita Popov wrote: >> >> > On Mon, Jan 5, 2015 at 11:58 PM, Stanislav Malyshev > > >> > 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