Received: from [140.186.70.92] (port=60700 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfLoh-0002VV-Ey for qemu-devel@nongnu.org; Sat, 31 Jul 2010 19:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfLof-0001aF-Q1 for qemu-devel@nongnu.org; Sat, 31 Jul 2010 19:50:11 -0400 Received: from hall.aurel32.net ([88.191.82.174]:47804) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfLof-0001Y8-Lc for qemu-devel@nongnu.org; Sat, 31 Jul 2010 19:50:09 -0400 Date: Sun, 1 Aug 2010 01:49:56 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Drop braces around single statement rule Message-ID: <20100731234956.GJ31640@hall.aurel32.net> References: <1280593414-2232-1-git-send-email-av1474@comtv.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Sat, Jul 31, 2010 at 08:23:55PM +0000, Blue Swirl wrote: > On Sat, Jul 31, 2010 at 4:23 PM, malc wrote: > > History has shown that this particular rule is unenforcable. > > > > Signed-off-by: malc > > --- > >  CODING_STYLE |   11 ++++++----- > >  1 files changed, 6 insertions(+), 5 deletions(-) > > Not again: > http://lists.nongnu.org/archive/html/qemu-devel/2009-12/msg00484.html > > There are plenty of ways to make the rule enforceable, for example we > could agree to start to revert commits which introduce new > CODING_STYLE violations. > It seems to be possible to add a pre-applypatch script to the git hook directory, that will verify the commit and reject it if it doesn't comply with the coding rules. Of course it's possible to commit a patch anyway by using --no-verify. The good point of this approach is that the rule is enforced by a script, which is not suppose to make mistakes, and that it can be shared between patch submitters and patch committers: both side can make mistakes and it is always better to know that as early as possible. Of course someone as to translate the coding rules in a set of regular expressions able to catch errors. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net