From: Junio C Hamano <gitster@pobox.com>
To: "Scott Chacon" <schacon@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
git@vger.kernel.org
Subject: Re: [PATCH] add a 'pre-push' hook
Date: Tue, 19 Aug 2008 16:35:34 -0700 [thread overview]
Message-ID: <7vy72swpbt.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <d411cc4a0808191258i9037a84k267c09795dffb3b8@mail.gmail.com> (Scott Chacon's message of "Tue, 19 Aug 2008 12:58:10 -0700")
"Scott Chacon" <schacon@gmail.com> writes:
> I would be happy to add the name of the branch being updated and the remote
> we're trying to push to. Is there interest then, in the patch?
I do not see a fundamental reason not to have a pre-push hook that
inspects what is going to be pushed where and declines it. We already do
"don't push non-fast-forward" on the sending end, and we can think of this
as an exhancement of that.
IOW, I am Ok with the goal. I haven't looked at the implementation,
though. I seem to recall all of tabstops in the patch were lost somewhere
between your editor and my MUA to make the patch unappliable, and stopped
reading there.
> Should I spend my
> precious brain cycles on adding that functionality?
Well, submitters pushing changes to scratch their own itch don't say "my
precious brain cycles". Reviewers working with submitter to polish and
accept the change to help the submitter, even when it is not their own
itch, do ;-).
In any case, I think passing the information necessary for the validation
to the hook is essential to make this patch worthwhile. Without it, I
have to agree with Jeff and Shawn that it is no better than a wrapper.
I merely raised destination URL and the tip that is sent as an example,
but I suspect we may also want to know the name of branch on the remote
side that is being updated, and the old tip commit on that branch as well.
The real issue about "that functionality" is what kind of information is
often needed and/or is enough, and we may need to look at what kind of
validation are useful in expected use scenarios.
For example, if your goal is "to enforce that the tip of the tree is
always without compilation errors", then you only need the commit that you
are sending. If however that policy applies only to some branches but not
other, you would need to know which branch you are sending things to. If
you are scanning what is sent to the remote side so that your published
history does not leak confidential information, you further need to know
the old tip and run "rev-list --objects old..new" and inspect all the new
objects you are sending, not just the tip.
I am just listing these off the top of my head; you as the original
submitter of the patch must have thought about the issues and use cases
much deeper than I did in the past 7 minutes while I am typing this
message, so you are in a better position to come up with various use cases
and the set of parameters the hook would need to do its validation job.
next prev parent reply other threads:[~2008-08-19 23:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1219170876-46893-1-git-send-email-schacon@gmail.com>
2008-08-19 18:55 ` [PATCH] add a 'pre-push' hook Scott Chacon
2008-08-19 18:58 ` Jeff King
2008-08-19 19:00 ` Scott Chacon
2008-08-19 19:08 ` Jeff King
2008-08-19 19:59 ` Shawn O. Pearce
2008-08-19 20:26 ` Scott Chacon
2008-08-19 21:26 ` しらいしななこ
2008-08-19 21:45 ` Scott Chacon
2008-08-19 22:23 ` Junio C Hamano
2008-08-19 22:26 ` Sam Vilain
2008-08-20 0:15 ` Jeff King
2008-08-19 19:39 ` Junio C Hamano
2008-08-19 19:58 ` Scott Chacon
2008-08-19 23:35 ` Junio C Hamano [this message]
2008-08-19 23:39 ` Shawn O. Pearce
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=7vy72swpbt.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=schacon@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox