From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Abrahams Subject: Re: cherry-pick / pre-commit hook? Date: Wed, 08 Dec 2010 16:22:23 -0500 Organization: BoostPro Computing Message-ID: References: <20101208175324.GB5687@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 Wed Dec 08 22:22:33 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 1PQRT5-0007Pe-Vg for gcvg-git-2@lo.gmane.org; Wed, 08 Dec 2010 22:22:32 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756603Ab0LHVWZ (ORCPT ); Wed, 8 Dec 2010 16:22:25 -0500 Received: from mail-qw0-f46.google.com ([209.85.216.46]:63466 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756158Ab0LHVWZ (ORCPT ); Wed, 8 Dec 2010 16:22:25 -0500 Received: by qwa26 with SMTP id 26so1769591qwa.19 for ; Wed, 08 Dec 2010 13:22:24 -0800 (PST) Received: by 10.224.74.1 with SMTP id s1mr2952278qaj.34.1291843343686; Wed, 08 Dec 2010 13:22:23 -0800 (PST) Received: from zreba.local (207-172-223-249.c3-0.smr-ubr3.sbo-smr.ma.static.cable.rcn.com [207.172.223.249]) by mx.google.com with ESMTPS id t35sm629183qco.30.2010.12.08.13.22.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Dec 2010 13:22:22 -0800 (PST) Received: from zreba.local (localhost [127.0.0.1]) by zreba.local (Postfix) with ESMTP id 5552638E1366; Wed, 8 Dec 2010 16:22:23 -0500 (EST) In-Reply-To: <20101208175324.GB5687@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: Hi Jonathan, At Wed, 8 Dec 2010 11:53:24 -0600, Jonathan Nieder wrote: > > $ git show -s 9fa4db5 > commit 9fa4db544e2e4d6c931f6adabc5270daec041536 > Author: Junio C Hamano > Date: Mon Aug 29 21:19:04 2005 -0700 > > Do not verify reverted/cherry-picked/rebased patches. > > The original committer may have used validation criteria that is less > stricter than yours. You do not want to lose the changes even if they > are done in substandard way from your 'commit -v' verifier's point of > view. > > Signed-off-by: Junio C Hamano > $ > > At last, an answer. The main purpose of the pre-commit hook (and > builtin checks that preceded it) is to avoid introducing regressions > in whitespace style, encoding, and so forth; but it would make > cherry-picking unnecessarily difficult, without preventing > regressions, to apply the same standards to existing code. I suspected as much. > > > Is there a hook that cherry-pick > > /will/ run instead? > > "git log --grep=pre-commit" seems to suggest that the commit-msg and > post-commit hooks will be run. But first, what are you trying to > accomplish? You're going to love this: I had sent a pull request upstream and the maintainer of the project rejected my changes because I didn't follow some formatting convention he didn't tell me about ;-). So I set up a commit hook that would prevent me from making the same mistake again, and cherry-picked the changes one-by-one. So it was exactly the same scenario, except I am the author of the original changes. I wonder whether this would have gone better had I used rebase. > Maybe there is a simpler way, or maybe with that use > case in mind we can make changes to support it better. Looking forward to hearing more. Thanks, -- Dave Abrahams BoostPro Computing http://www.boostpro.com