Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Scott Chacon <schacon@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] add a 'pre-push' hook
Date: Tue, 19 Aug 2008 15:08:32 -0400	[thread overview]
Message-ID: <20080819190832.GC17943@coredump.intra.peff.net> (raw)
In-Reply-To: <d411cc4a0808191200o39837fd0ka2530aed870e06b0@mail.gmail.com>

On Tue, Aug 19, 2008 at 12:00:38PM -0700, Scott Chacon wrote:

> If the patch is acceptable, I will update the githooks doc with more
> information, but we would like this so that you could add a hook that
> runs your automated tests before a push would go through.

I think the common wisdom has been that such tests should be done on the
_receiving_ end, since that makes a more trustworthy enforcement point.
E.g., I know that crap can't get into my central repo because a hook
checks everything coming in. But if a developer has turned off his
pre-push hook (or accidentally failed to enable it), he can still send
crap.

One other argument I have seen is that, to prevent the proliferation of
hooks, the rule is not to add a hook that could just as easily be done
as a sequence of commands. IOW, what's wrong with

  run_my_automated_tests && git push

?

Off the top of my head, I guess the response to those two arguments
would be:

 - sometimes the receiving end isn't set up to run tests, which means it
   is more reasonable to do it on the sending side

 - it's more convenient to just type "git push" than to remember "tests
   && git push", so this reduces the chances of contributors
   accidentally pushing crap

-Peff

  reply	other threads:[~2008-08-19 19:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1219170876-46893-1-git-send-email-schacon@gmail.com>
2008-08-19 18:55 ` [PATCH] add a 'pre-push' hook Scott Chacon
2008-08-19 18:58   ` Jeff King
2008-08-19 19:00     ` Scott Chacon
2008-08-19 19:08       ` Jeff King [this message]
2008-08-19 19:59         ` Shawn O. Pearce
2008-08-19 20:26           ` Scott Chacon
2008-08-19 21:26             ` しらいしななこ
2008-08-19 21:45               ` Scott Chacon
2008-08-19 22:23                 ` Junio C Hamano
2008-08-19 22:26         ` Sam Vilain
2008-08-20  0:15           ` Jeff King
2008-08-19 19:39       ` Junio C Hamano
2008-08-19 19:58         ` Scott Chacon
2008-08-19 23:35           ` Junio C Hamano
2008-08-19 23:39             ` Shawn O. Pearce

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=20080819190832.GC17943@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=schacon@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