From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Abrahams Subject: Re: cherry-pick / pre-commit hook? Date: Sun, 26 Dec 2010 17:18:12 -0900 Organization: BoostPro Computing Message-ID: References: <20101208175324.GB5687@burratino> <20101208220514.GA8865@burratino> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: git@vger.kernel.org To: Jonathan Nieder X-From: git-owner@vger.kernel.org Mon Dec 27 03:19:35 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PX2gM-0001UI-RO for gcvg-git-2@lo.gmane.org; Mon, 27 Dec 2010 03:19:31 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753316Ab0L0CST (ORCPT ); Sun, 26 Dec 2010 21:18:19 -0500 Received: from mail-px0-f174.google.com ([209.85.212.174]:33744 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752962Ab0L0CST (ORCPT ); Sun, 26 Dec 2010 21:18:19 -0500 Received: by pxi15 with SMTP id 15so1581364pxi.19 for ; Sun, 26 Dec 2010 18:18:18 -0800 (PST) Received: by 10.142.179.7 with SMTP id b7mr9569198wff.147.1293416298131; Sun, 26 Dec 2010 18:18:18 -0800 (PST) Received: from zreba.local (92-52-237-24.gci.net [24.237.52.92]) by mx.google.com with ESMTPS id w14sm16949730wfd.18.2010.12.26.18.18.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 26 Dec 2010 18:18:16 -0800 (PST) Received: from zreba.local (localhost [127.0.0.1]) by zreba.local (Postfix) with ESMTP id A5F2F3AD0D5F; Sun, 26 Dec 2010 17:18:12 -0900 (AKST) In-Reply-To: <20101208220514.GA8865@burratino> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.2 (x86_64-apple-darwin) MULE/6.0 (HANACHIRUSATO) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: At Wed, 8 Dec 2010 16:05:14 -0600, Jonathan Nieder wrote: > > The main purpose of the pre-commit and commit-msg hooks is to avoid > introducing regressions in whitespace style, encoding, and so forth; > and it would make cherry-picking unnecessarily difficult, without > preventing regressions, to unconditionally apply the same standards to > existing code. For this reason, in v0.99.6~51 (2005-08-29), git > learned to skip the usual hooks when cherry-picking or reverting an > existing commit. > > But sometimes the checks are wanted anyway. For example, with this > patch applied, you can safely fetch some new contributor's code: > > $ git cherry-pick -s --verify HEAD..FETCH_HEAD > > while allowing the pre-commit and commit-msg hooks to run their usual > checks so the result can error out if the patches are not clean. > > Signed-off-by: Jonathan Nieder > --- > Untested. Please feel free to add some documentation and tests and > submit it for real if this looks like a good idea. :) Well, thanks, but sadly I can only invest enough time to file this bug report right now: if you're going to have a "pre-commit hook" concept, but not run that hook for some kinds of commits, then that fact needs to be documented. -- Dave Abrahams BoostPro Computing http://www.boostpro.com