From: Jeff King <peff@peff.net>
To: Leo Gaspard <leo@gaspard.io>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Joey Hess" <id@joeyh.name>,
git@vger.kernel.org, "Brandon Williams" <bmwill@google.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: Re: Fetch-hooks
Date: Mon, 19 Feb 2018 16:23:47 -0500 [thread overview]
Message-ID: <20180219212347.GA9748@sigill.intra.peff.net> (raw)
In-Reply-To: <96dd7fb3-849b-8de6-7c3a-cd6bde9da432@gaspard.io>
On Wed, Feb 14, 2018 at 03:02:00AM +0100, Leo Gaspard wrote:
> > So does anybody actually want to be able to adjust the refs as they pass
> > through? It really sounds like you just want to be able to reject or not
> > reject the fetch. And that rejecting would be the uncommon case, so it's
> > OK to just abort the whole operation and expect the user to figure it
> > out.
>
> This completely fits my use case (modulo the fact that it's more similar
> to the `update` hook than to `pre-receive` I think, as verifying the
> signature requires the objects to already have been downloaded), indeed,
> though I'm not sure it would have fit Joey's (based on my understanding,
> adding a merge was what was originally asked for).
>
> Actually, I'm wondering if the existing semantics of `update` could not
> be reused for the `pre-fetch`. Would it make sense to just call `update`
> during a fetch in the same way as during a receive-pack? That said it
> likely makes this a breaking change, though it's maybe unlikely that a
> repository is used both for fetching and for receive-pack'ing, it could
> happen.
>
> So the proposal as I understand it would currently be adding a
> `fetch-update` hook that does exactly the same thing as `update` but for
> `fetch`. This solves my use case in a nice way, though it likely doesn't
> solve Joey's original one (which has been taken care of by a wrapper
> since then).
>
> What do you all think about it?
I think it should be a separate hook; having an existing hook trigger in
new places is likely to cause confusion and regressions.
If you do go this route, please model it after "pre-receive" rather than
"update". We had "update" originally but found it was too limiting for
hooks to see only one ref at a time. So we introduced pre-receive. The
"update" hook remains for historical reasons, but I don't think we'd
want to reproduce the mistake. :)
-Peff
next prev parent reply other threads:[~2018-02-19 21:23 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-07 21:56 Fetch-hooks Leo Gaspard
2018-02-07 22:51 ` Fetch-hooks Ævar Arnfjörð Bjarmason
2018-02-08 0:06 ` Fetch-hooks Leo Gaspard
2018-02-08 15:30 ` Fetch-hooks Joey Hess
2018-02-08 17:02 ` Fetch-hooks Leo Gaspard
2018-02-08 21:06 ` Fetch-hooks Ævar Arnfjörð Bjarmason
2018-02-08 22:18 ` Fetch-hooks Leo Gaspard
2018-02-09 22:04 ` Fetch-hooks Ævar Arnfjörð Bjarmason
2018-02-09 22:24 ` Fetch-hooks Leo Gaspard
2018-02-09 22:56 ` Fetch-hooks Ævar Arnfjörð Bjarmason
2018-02-09 22:30 ` Fetch-hooks Jeff King
2018-02-09 22:45 ` Fetch-hooks Junio C Hamano
2018-02-09 23:49 ` Fetch-hooks Leo Gaspard
2018-02-10 0:13 ` Fetch-hooks Jeff King
2018-02-10 0:37 ` Fetch-hooks Leo Gaspard
2018-02-10 1:08 ` Fetch-hooks Junio C Hamano
2018-02-10 1:33 ` Fetch-hooks Leo Gaspard
2018-02-10 18:03 ` Fetch-hooks Leo Gaspard
2018-02-10 12:21 ` Fetch-hooks Jeff King
2018-02-10 18:36 ` Fetch-hooks Leo Gaspard
2018-02-12 19:23 ` Fetch-hooks Brandon Williams
2018-02-13 15:44 ` Fetch-hooks Leo Gaspard
2018-02-14 1:38 ` Fetch-hooks Jeff King
2018-02-14 1:35 ` Fetch-hooks Jeff King
2018-02-14 2:02 ` Fetch-hooks Leo Gaspard
2018-02-19 21:23 ` Jeff King [this message]
2018-02-19 22:50 ` Fetch-hooks Leo Gaspard
2018-02-20 6:10 ` Fetch-hooks Jacob Keller
2018-02-20 7:42 ` Fetch-hooks Jeff King
2018-02-20 21:19 ` Fetch-hooks Leo Gaspard
2018-02-14 1:46 ` Fetch-hooks Jacob Keller
2018-02-09 19:12 ` Fetch-hooks Leo Gaspard
2018-02-09 20:20 ` Fetch-hooks Joey Hess
2018-02-09 21:28 ` [PATCH 0/2] fetch: add tweak-fetch hook Leo Gaspard
2018-02-09 21:44 ` [PATCH 1/2] fetch: preparations for " Leo Gaspard
2018-02-09 21:44 ` [PATCH 2/2] fetch: add " Leo Gaspard
2018-02-09 22:40 ` Junio C Hamano
2018-02-09 22:34 ` [PATCH 1/2] fetch: preparations for " 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=20180219212347.GA9748@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=avarab@gmail.com \
--cc=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=id@joeyh.name \
--cc=leo@gaspard.io \
/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).