All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: git@vger.kernel.org
Subject: [PATCH 0/4] pre-push hook support
Date: Fri, 28 Dec 2012 17:57:28 -0500	[thread overview]
Message-ID: <1356735452-21667-1-git-send-email-aaron@schrab.com> (raw)

There have been at least a couple of submissions to add support for a
pre-push hook, which were rejected at least partially because they didn't
provide enough information to a hook script for it to determine what was
to be pushed any better than a separate wrapper around the 'git push'
command would be able to do.  In this series I attempt to address that
problem.

The first two patches in this series do a little bit of refactoring in
order to make it easier to call hooks with a variable number of arguments.

The third patch actually adds support for calling a pre-push hook.  If it
exists, it will be called with the name and URL of the destination remote
(if a named remote isn't being used, the URL will be supplied for both)
followed by another argument for each ref being pushed; these arguments
take the form:

  <local ref>:<local sha1>:<remote ref>:<remote sha1>

This should provide enough information for a script to easily determine
the set of commits that is being pushed, and thus make a decision if that
should be allowed.

The final patch adds a sample pre-push hook script which will deny
attempts to push commits that are marked as a work in progress.

Aaron Schrab (4):
  hooks: Add function to check if a hook exists
  hooks: support variable number of parameters
  push: Add support for pre-push hooks
  Add sample pre-push hook script

 Documentation/githooks.txt       |   28 ++++++++
 builtin/push.c                   |    1 +
 run-command.c                    |   35 ++++++---
 run-command.h                    |    3 +
 t/t5571-pre-push-hook.sh         |  145 ++++++++++++++++++++++++++++++++++++++
 templates/hooks--pre-push.sample |   63 +++++++++++++++++
 transport.c                      |   25 +++++++
 transport.h                      |    1 +
 8 files changed, 292 insertions(+), 9 deletions(-)
 create mode 100755 t/t5571-pre-push-hook.sh
 create mode 100644 templates/hooks--pre-push.sample

-- 
1.7.10.4

             reply	other threads:[~2012-12-28 22:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 22:57 Aaron Schrab [this message]
2012-12-28 22:57 ` [PATCH 1/4] hooks: Add function to check if a hook exists Aaron Schrab
2012-12-29  2:08   ` Junio C Hamano
2012-12-29 14:50     ` Aaron Schrab
2012-12-29 16:54       ` Junio C Hamano
2012-12-28 22:57 ` [PATCH 2/4] hooks: support variable number of parameters Aaron Schrab
2012-12-28 22:57 ` [PATCH 3/4] push: Add support for pre-push hooks Aaron Schrab
2012-12-28 22:57 ` [PATCH 4/4] Add sample pre-push hook script Aaron Schrab
2012-12-29  2:01 ` [PATCH 0/4] pre-push hook support Junio C Hamano
2012-12-29 14:50   ` Aaron Schrab
2012-12-29 16:48     ` Junio C Hamano
2013-01-13  5:17 ` [PATCH v2 0/3] " Aaron Schrab
2013-01-14 17:42   ` Junio C Hamano
2013-01-14 22:54     ` Junio C Hamano
2013-01-15  0:24       ` Junio C Hamano
2013-01-13  5:17 ` [PATCH v2 1/3] hooks: Add function to check if a hook exists Aaron Schrab
2013-01-13  5:17 ` [PATCH v2 2/3] push: Add support for pre-push hooks Aaron Schrab
2013-01-14 17:39   ` Junio C Hamano
2013-01-15  0:36   ` Junio C Hamano
2013-01-15  3:12     ` Junio C Hamano
2013-01-13  5:17 ` [PATCH v2 3/3] Add sample pre-push hook script Aaron Schrab
2013-01-14 17:42   ` Junio C Hamano

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=1356735452-21667-1-git-send-email-aaron@schrab.com \
    --to=aaron@schrab.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.