From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: git@vger.kernel.org
Cc: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Subject: [PATCH 0/3] Propagating push options to remote hooks
Date: Sat, 30 Jan 2016 19:28:07 +0100 [thread overview]
Message-ID: <1454178490-17873-1-git-send-email-dennis@kaarsemaker.net> (raw)
I have a few pre-receive hooks that are meant to catch mistakes. They are
fairly strict, as the mistakes it catches can have some serious bad effects.
However, sometimes they get it wrong (and can't really get it right) and it
would be really useful to override them.
Currently I do this by parseing the commit message, looking for 'Force: true',
but it would be very useful if --force were propagated to the hook. Obviously,
making --force skip all remote hooks would be a very bad way of doing this.
Hooks should decide whether --force is respected or not.
Instead of that, we can pass options to receive-pack using a new capability,
and receive-pack can make it available to hooks in their environment. That way
we don't change behaviour of existing hooks and each hook can decide for itself
whether it respects these options.
The initial implementation only passes on --quiet and --force. I've been
thinking of allowing the user of push to specify arbitrary values, but don't
see the value of that yet. It would be easy to add though.
Dennis Kaarsemaker (3):
connect.[ch]: make parse_feature_value non-static
receive-pack: add a capability for hook options
send-pack: propagate --force and --quiet to remote hooks
Documentation/technical/protocol-capabilities.txt | 9 ++++++
builtin/receive-pack.c | 19 ++++++++++--
connect.c | 3 +-
connect.h | 1 +
send-pack.c | 10 ++++++
t/t5544-push-hook-options.sh | 37 +++++++++++++++++++++++
6 files changed, 75 insertions(+), 4 deletions(-)
create mode 100755 t/t5544-push-hook-options.sh
--
2.7.0-91-gf04ef09
next reply other threads:[~2016-01-30 18:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-30 18:28 Dennis Kaarsemaker [this message]
2016-01-30 18:28 ` [PATCH 1/3] connect.[ch]: make parse_feature_value non-static Dennis Kaarsemaker
2016-01-30 18:28 ` [PATCH 2/3] receive-pack: add a capability for hook options Dennis Kaarsemaker
2016-01-30 18:28 ` [PATCH 3/3] send-pack: propagate --force and --quiet to remote hooks Dennis Kaarsemaker
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=1454178490-17873-1-git-send-email-dennis@kaarsemaker.net \
--to=dennis@kaarsemaker.net \
--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 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).