From: ZheNing Hu <adlternative@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Taylor Blau <me@ttaylorr.com>
Subject: [QUESTION]: How to get uploading git objects via a git command in a pre-receive-hook
Date: Sat, 29 Jun 2024 22:42:32 +0800 [thread overview]
Message-ID: <CAOLTT8Sb4+_L7TrP8zZvvSqFu0MqbDanOhi6jfxfRLQKRimYzw@mail.gmail.com> (raw)
Hi,
I want to check the uploaded Git LFS objects in the pre-receive hook
of the Git server. Assuming that the Git repository during the upload
process is A.git, my current approach is to create an empty repository
B.git and then use
GIT_ALTERNATE_OBJECT_DIRECTORIES="A.git/objects/tmp_objdir-incoming-**"
followed by executing git -C B.git cat-file --batch-check
--batch-all-objects to obtain the objects being uploaded, then filter
out the LFS objects. This process is very time-consuming, taking
roughly more than 10 seconds. I wonder if there's a simpler method?
Thanks.
--
ZheNing Hu
next reply other threads:[~2024-06-29 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-29 14:42 ZheNing Hu [this message]
2024-06-29 16:29 ` [QUESTION]: How to get uploading git objects via a git command in a pre-receive-hook Christian Couder
2024-07-01 3:40 ` 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=CAOLTT8Sb4+_L7TrP8zZvvSqFu0MqbDanOhi6jfxfRLQKRimYzw@mail.gmail.com \
--to=adlternative@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.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.
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).