git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Xheroz 128 <kenneth.951218@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Git extra hook, pre-upload
Date: Sun, 30 Dec 2018 22:34:26 +0100	[thread overview]
Message-ID: <87k1jqem1p.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <754B8F69-BD83-4EBB-9E86-6DF845624B1B@gmail.com>


On Sun, Dec 30 2018, Xheroz 128 wrote:

> Currently, I’m doing my Final Year Project that requires a hook that executes automatically on the server side of the repository, before the objects been pulled to the client side, and after the objects have been pushed to the server side, which is "post-receive" hook. The post-receive hook work well for me, but I couldn’t find any hook to be executed immediately before an upload-operation is performed, i.e. before data is sent to the client.
>
> Why Git doesn't have a hook that executed immediately before the data is sent to the client? Any advice on getting this hook or any similar function of the hook?

We do not have such a pre-upload hook, but could have one. There's an
old thread from 2011 detailing some potential downsides:

https://public-inbox.org/git/CAMK1S_jaEWV=F6iHKZw_6u5ncDW0bPosNx-03W9bOLOfEEEY1Q@mail.gmail.com/

FWIW I think most servers who find themselves needing such a hook use it
to e.g. log how many fetches a given repository might serve, and end up
instead wrapping git commands in some custom shell.

It's also possible to imagine a much deeper integration for such a hook,
e.g. something that would allow you to implement the functionality of
the uploadpack.* variables and more in your own code, but I don't know
if that's the sort of thing you're imagining.

  reply	other threads:[~2018-12-30 21:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-30 20:11 Git extra hook, pre-upload Xheroz 128
2018-12-30 21:34 ` Ævar Arnfjörð Bjarmason [this message]
2019-01-02 17:27   ` Junio C Hamano
2019-01-03  7:29   ` Jeff King
     [not found]     ` <A842150D-2A45-4ABB-9B0F-DF516F7A2737@gmail.com>
2019-01-06  6:07       ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1jqem1p.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kenneth.951218@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).