public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Jason Merrill <jason@redhat.com>,
	Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
	gcc Mailing List <gcc@gcc.gnu.org>,
	Gerald Pfeifer <gerald@pfeifer.com>,
	Daniel Berlin <dberlin@dberlin.org>
Subject: Re: GCC Git hooks
Date: Fri, 10 Jan 2020 17:38:00 -0000	[thread overview]
Message-ID: <20200110173847.GF3313@adacore.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2001091417030.4040@digraph.polyomino.org.uk>

Hi Joseph,

Apologies for the slow replies. The end of this week has been
pretty packed, and next week will be as well. But I will make
sure we answer every questions and suggestions you have!

On Thu, Jan 09, 2020 at 02:25:59PM +0000, Joseph Myers wrote:
> On Mon, 16 Sep 2019, Joel Brobecker wrote:
> 
> > Looking at the configuration file, I believe the git-hooks
> > should have most, if not all, of the features that would be needed for
> > the GCC repository. In particular, there is already a way to relay
> > commits to third-party tools via calling of a script; GDB uses that
> > to interface with their Bugzilla database.
> 
> I am now looking at the hook setup for GCC.  As far as I can see, I'll 
> initially need a GCC-specific fork of the hooks for two reasons:
> 
> * Custom ref naming.  The refs/vendors/<vendor>/{heads,tags} and 
> refs/users/<user>/{heads,tags} scheme described at 
> <https://gcc.gnu.org/ml/gcc/2019-11/msg00249.html>, to avoid such branches 
> being fetched by default, will need the hooks to know that such ref names 
> are to be treated as branches / tags, and to allow non-fast-forward pushes 
> to them.

That's actually a neat way of dealing with vendor branches. I have
always felt it was suboptimal that everyone had to fetch updates
in vendor branches in the GDB repositories. I don't know if I could
convince the GDB community to use this scheme, but I think it's
pretty clever.

I'll make sure there is a way to handle that without needing to
create your own version of the git-hooks.

> * I don't see a configuration option to add custom checks before accepting 
> a ref update.  I think we want a custom check that prevents people for 
> accidentally pushing merges between the old and new versions of the GCC 
> history.  It's easy to write something called from a pre-receive / update 
> hook that uses git rev-list to identify problem pushes, but doing that 
> without a fork of the hooks would require a suitable configuration option 
> to call out to such a custom script.

I think an update-hook setting allowing repositories to have a script
called to perform additional ad hoc verifications sounds like it could
be generally useful.

For the specific issue that you are trying to protect against, that's
unlikely to happen, IMO. When someone pushes a commit, what the hooks
do is look at the list of commits which are being added to that branch.
If the number of such commits exceed a limit (100 by default), it
rejects that push. I think a user trying to push a merge that points
to the old history will hit that rejection.

I will add both of these features to my TODO list.

-- 
Joel

      parent reply	other threads:[~2020-01-10 17:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-14 20:53 Jason Merrill
2019-09-15  1:54 ` Joseph Myers
2019-09-15  3:50 ` Gerald Pfeifer
2019-09-15 12:07   ` Joseph Myers
2019-09-15 16:16     ` Gerald Pfeifer
2019-09-16 15:11       ` Joel Brobecker
2019-09-16 20:02       ` Joseph Myers
2019-09-17 11:13         ` Gerald Pfeifer
2019-09-17 12:55           ` Joel Brobecker
2019-09-17 15:56           ` Joseph Myers
2019-09-16 15:06 ` Joel Brobecker
2019-09-26 12:41   ` Joel Brobecker
2020-01-09 14:26   ` Joseph Myers
2020-01-09 22:07     ` Joseph Myers
2020-01-10 11:03       ` Jonathan Wakely
2020-01-10 13:06         ` Joseph Myers
2020-01-10 13:38           ` Jonathan Wakely
2020-01-10 15:53       ` Joseph Myers
2020-01-10 18:00         ` Joel Brobecker
2020-01-10 18:15           ` Joseph Myers
2020-01-10 18:22             ` Joel Brobecker
2020-01-10 18:24               ` Joseph Myers
2020-01-10 18:40                 ` Joel Brobecker
2020-01-10 20:44         ` Joseph Myers
2020-01-13 20:47           ` Joseph Myers
2020-01-10 17:57       ` Joel Brobecker
2020-01-10 17:38     ` Joel Brobecker [this message]

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=20200110173847.GF3313@adacore.com \
    --to=brobecker@adacore.com \
    --cc=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=maxim.kuvyrkov@linaro.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 read-only IMAP folder(s) and NNTP newsgroup(s).