git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Abrahams <dave@boostpro.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: cherry-pick / pre-commit hook?
Date: Wed, 08 Dec 2010 16:22:23 -0500	[thread overview]
Message-ID: <m2oc8wt0xc.wl%dave@boostpro.com> (raw)
In-Reply-To: <20101208175324.GB5687@burratino>


Hi Jonathan,

At Wed, 8 Dec 2010 11:53:24 -0600,
Jonathan Nieder wrote:
> 
>  $ git show -s 9fa4db5
>  commit 9fa4db544e2e4d6c931f6adabc5270daec041536
>  Author: Junio C Hamano <junkio@cox.net>
>  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 <junkio@cox.net>
>  $
> 
> 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

  reply	other threads:[~2010-12-08 21:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 17:10 cherry-pick / pre-commit hook? Dave Abrahams
2010-12-08 17:53 ` Jonathan Nieder
2010-12-08 21:22   ` Dave Abrahams [this message]
2010-12-08 22:05     ` Jonathan Nieder
2010-12-27  2:18       ` Dave Abrahams
2010-12-27  9:37         ` Jonathan Nieder
2010-12-27 20:58           ` Junio C Hamano
2010-12-27 21:33             ` Dave Abrahams
2010-12-28 18:16           ` Junio C Hamano
2010-12-28 22:38             ` Jakub Narebski
2010-12-29  1:00               ` Dave Abrahams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2oc8wt0xc.wl%dave@boostpro.com \
    --to=dave@boostpro.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).