From: Sitaram Chamarty <sitaramc@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Git <git@vger.kernel.org>
Subject: Re: what are the chances of a 'pre-upload' hook?
Date: Mon, 28 Nov 2011 13:47:44 +0530 [thread overview]
Message-ID: <CAMK1S_hX3fEf1nL28yxASLw_cveJbC5aQRdixgBF6zaPyAEsdA@mail.gmail.com> (raw)
In-Reply-To: <7vzkfgvjdo.fsf@alter.siamese.dyndns.org>
On Mon, Nov 28, 2011 at 12:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
>
>>> I actually like the idea of allowing pre-upload-pack hook on git:// and
>>> possibly http:// only....
>>>
>>> One scenario I do not want to see is this. Suppose ...
>>
>> I'm sorry I started this discussion. I worked around it, though it's
>> a bit kludgy, so maybe time to drop the debate.
>
> I do not want you to feel sorry, and I do not understand why you feel that
> way.
Because I did not think it was so complicated...? :-)
> I think a reasonable and safe way to trigger an action in response to a
> request to fetch from a repository _is_ a sensible thing to wish for. So
> far, we established that we cannot just simply add pre-upload hook back in
> and be done with it, as that is not a safe way. We learned something.
> Jeff may be right that any approach based on hooks cannot be made totally
> safe. But the discussion can lead to a workable alternative. The "enable
> the hook only on git:// and http:// and no other" approach might or might
> not be such a workable alternative. The "try talking to a service process
> via named pipe, instead of spawning a hook" might or might not be such a
> workable alternative. Other possibilities may be there to be explored.
There are only 2 cases: git-upload-pack runs as invoking user, or it
runs as some common user/repo owner.
I see pre-upload hooks for case 1 as being hard/impossible to do,
while case 2 is trivial (just check if the hook file owner == UID of
the git-upload-pack process).
Yes, this means pre-upload won't work identically in *all* setups.
But as you said somewhere: perfect is the enemy of good.
next prev parent reply other threads:[~2011-11-28 8:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 3:16 what are the chances of a 'pre-upload' hook? Sitaram Chamarty
2011-11-25 3:18 ` Martin Fick
2011-11-25 3:22 ` Martin Fick
2011-11-25 4:13 ` Sitaram Chamarty
2011-11-25 13:09 ` Andreas Ericsson
2011-11-25 16:18 ` Sitaram Chamarty
2011-11-25 14:40 ` Jeff King
2011-11-26 22:34 ` Junio C Hamano
2011-11-26 22:55 ` Jeff King
2011-11-26 23:13 ` Junio C Hamano
2011-11-26 23:31 ` Jeff King
[not found] ` <CAPc5daXY_4aimugj8Z4BFE8YvBSM1K+evPU69rLGH5ETo6PO=Q@mail.gmail.com>
2011-11-26 23:51 ` Jeff King
[not found] ` <CAPc5daUodry_=6pZxA=QOpuRUj9C2ed9Gzp6E1_G93iGfOOvOA@mail.gmail.com>
2011-11-27 0:06 ` Jeff King
2011-11-27 8:56 ` Junio C Hamano
2011-11-27 13:16 ` Sitaram Chamarty
2011-11-28 6:41 ` Junio C Hamano
2011-11-28 8:01 ` Jeff King
2011-11-28 9:21 ` Sitaram Chamarty
2011-11-28 8:17 ` Sitaram Chamarty [this message]
2011-11-28 8:27 ` Jeff King
2011-11-27 7:51 ` Junio C Hamano
2011-11-28 7:51 ` Jeff King
2011-11-28 8:17 ` 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=CAMK1S_hX3fEf1nL28yxASLw_cveJbC5aQRdixgBF6zaPyAEsdA@mail.gmail.com \
--to=sitaramc@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).