From: Junio C Hamano <gitster@pobox.com>
To: Brian Vandenberg <phantall@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] [RFC] Make git-update-ref invoke the update and post-update hooks
Date: Mon, 15 Jun 2015 13:22:47 -0700 [thread overview]
Message-ID: <xmqqpp4w7mco.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAEJ-0i-BB=5W-Ah3nkeLFCe5-4XW4CvYaDgdqv1mMp4UGF81qw@mail.gmail.com> (Brian Vandenberg's message of "Mon, 15 Jun 2015 13:49:36 -0600")
Brian Vandenberg <phantall@gmail.com> writes:
> From: Junio C Hamano <junkio@cox.net>
> Date: 2006-10-08 15:00:32
> Petr Baudis <pasky@suse.cz> writes:
>
>>> Someone raised a concern that the update and post-update hooks are not
>>> invoked at fetch time in the similar way as they are invoked at push
>>> time, and the idea sort of makes sense. But this patch goes further - it
>>> makes Git invoke those hooks each time a ref is updated in a repository
>>> using the git-update-ref command, which I believe makes a lot of sense as
>>> well - the behaviour is consistent with the current pushing behaviour
>>> and you suddenly finally get a hook where you can properly notify even
>>> about fast-forwards etc.
>
>>In principle I do not have problem with this approach per-se,
>>but I wonder if we were to do this we might want to make
>>receive-pack.c::update() and cmd_update_ref() call the same
>>underlying function, and make that underlying function implement
>>this "ask the hook if updating is ok" dance. It might even make
>>sense to have update-ref honor deny_non_fast_forwards for that
>>matter (I am mildly doubtful of this last point, though).
I am ultra-doubtful at this point ;-)
For one thing, update-ref is not a tool that is exclusive to
receiving object transfer aka receive-pack, so it makes no sense for
it to pay attention to post-update.
Also it is a low-level plumbing; the policy issues should come at a
level higher than that. I.e. Porcelain scripts implemented using
them as building blocks should be the ones that you do your policy,
e.g.
if whatever logic you want to use in your policy says OK
then
git update-ref ...args...
else
echo >&2 "My policy does not like your arguments"
exit 1
fi
next prev parent reply other threads:[~2015-06-15 20:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-15 19:49 [PATCH] [RFC] Make git-update-ref invoke the update and post-update hooks Brian Vandenberg
2015-06-15 20:22 ` Junio C Hamano [this message]
2015-06-15 20:58 ` Brian Vandenberg
2015-06-15 21:45 ` Junio C Hamano
2015-06-16 14:31 ` Brian Vandenberg
-- strict thread matches above, loose matches on Subject: below --
2006-10-08 0:08 Petr Baudis
2006-10-08 5:00 ` 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=xmqqpp4w7mco.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=phantall@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.