From: Junio C Hamano <gitster@pobox.com>
To: manigandans <etc.mani@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Find the size of git push in pre-receive hook
Date: Fri, 04 Nov 2011 11:01:29 -0700 [thread overview]
Message-ID: <7vaa8bdax2.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1320398420796-6962141.post@n2.nabble.com> (manigandans's message of "Fri, 4 Nov 2011 02:20:20 -0700 (PDT)")
manigandans <etc.mani@gmail.com> writes:
> I want to restrict the size of the push on the git remote repository. How
> can I find the size of the push in pre-receive hook?
You don't.
What are you trying to solve?
The thing is, by the time pre-receive-hook is run, the packs have already
been transferred to the destination. Otherwise pre-receive-hook cannot do
its primary task of inspecting the history the push is trying to update
the refs with and allow or deny the ref updates.
Presumably you could run "git rev-list --objects" between the values of
refs before and after the proposed updates, sum up their sizes and reject
the push when the push adds too much data for your liking, and the next gc
will clean things up, but if your goal is to cap the maximum disk quota
including the transient use during the time pre-receive-hook is run, it
would not help.
next prev parent reply other threads:[~2011-11-04 18:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-04 9:20 Find the size of git push in pre-receive hook manigandans
2011-11-04 9:46 ` Magnus Bäck
2011-11-04 18:01 ` Junio C Hamano [this message]
[not found] ` <CAFx4vfb-ssFXFEy9We7U+5+Fi+QsbcckNOEh1eXbMiqNfkU7jQ@mail.gmail.com>
2011-11-07 5:42 ` Junio C Hamano
2011-11-08 5:41 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vaa8bdax2.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=etc.mani@gmail.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 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).