On Tue, May 12, 2009 at 09:32:18AM -0300, Devan Goodwin wrote:
>
> > On Thu, Mar 12, 2009 at 09:33:44AM -0300, Devan Goodwin wrote:
> > >
> > > Works for me. Yeah I'd be in favor of the commit hook.
> >
> > My first attempt at the hook which would catch commits that seems to
> > be automatic merges done during git pull is in the attachment.
> >
>
> I did a merge master to pgsql merge yesterday, I used the default
> commit msg at first and this was rejected by your script. I did a git
> commit --amend and changed the message to not match the regex:
>
> if ($msg =~ /^Merge branch \S+ of \S+\n*$/s) {
> }
>
> But I still get:
>
> $ git push origin pgsql
> Counting objects: 204, done.
> Compressing objects: 100% (68/68), done.
> Writing objects: 100% (74/74), 8.92 KiB, done.
> Total 74 (delta 61), reused 0 (delta 0)
> Commit [d1c65b572d1b9e1ccd863cce3104a853acc9ad9f] looks like automatic
> merge when you did not rebase after pull.
> To ssh://[email protected]/git/spacewalk.git
> error: hooks/pre-receive exited with error code 1
> ! [remote rejected] pgsql -> pgsql (pre-receive hook declined)
> error: failed to push some refs to
> 'ssh://[email protected]/git/spacewalk.git'
>
> The commit it's complaining about is not my most recent:
The hook checks all commits that are being "added" to the ref since
you can do multiple commits (and multiple merge commits) with one
push.
> $ git show d1c65b572d1b9e1ccd863cce3104a853acc9ad9f
> commit d1c65b572d1b9e1ccd863cce3104a853acc9ad9f
> Merge: ef29cde... 1e0d837...
> Author: Jan Pazdziora <[email protected]>
> Date: Tue Apr 21 10:39:27 2009 +0200
>
> Merge branch 'master' of ssh://git.fedorahosted.org/git/spacewalk
>
>
> Jan, is there something I can do to edit that message and get this push
> to work?
The one of d1c65b572d1b9e1ccd863cce3104a853acc9ad9f? Nope. The best
bet will probably be to ask the infrastructure guys to disable the
hook, do the push, and enable it again. Upon subsequent pushes, the
commit will already not be considered by the hook.
--
Jan Pazdziora
Senior Software Engineer, Satellite Engineering, Red Hat
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel