From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2551 invoked by alias); 21 Dec 2014 22:46:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2517 invoked by uid 89); 21 Dec 2014 22:46:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 21 Dec 2014 22:46:08 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1B04F1163A1; Sun, 21 Dec 2014 17:46:07 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yrgwM5BByq-e; Sun, 21 Dec 2014 17:46:07 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F21CC116388; Sun, 21 Dec 2014 17:46:06 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 6105548812; Sun, 21 Dec 2014 17:46:07 -0500 (EST) Date: Sun, 21 Dec 2014 22:46:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: Re: RFC: using AdaCore's git hooks for binutils-gdb.git ... Message-ID: <20141221224607.GN12884@adacore.com> References: <20141128135756.GK548@adacore.com> <20141207142138.GJ7899@adacore.com> <20141213165103.GA26944@adacore.com> <20141214204731.GA15244@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qtZFehHsKgwS5rPz" Content-Disposition: inline In-Reply-To: <20141214204731.GA15244@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-12/txt/msg00604.txt.bz2 --qtZFehHsKgwS5rPz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 4028 OK, good news, I think I'm near being done! > Next on my list (in random order): > > - Provide a way to call the script which sends updates to bugzilla > > - Add a post-receive hook which we would call at the end > of our post-receive hook. This hook would then allow us > to the irker hook, for IRC notification. > > - Add an option to include a URL of the commit in the emails. > > - Merge commit control. All the above have been done :) > - Verify compatibility of the new hooks with the git version > installed on sourceware.org. This is where thing didn't go as well as I had hoped. I found that working with the versions of Python and git installed on sourceware would be too hard. So I sent an email to overseers to discuss solution about using newer versions. I don't think it'll take very long to resolve. > Once that's done, I think all features provided by the current hooks > will also be available in the new hooks, so we'll be able to start > working on the integration. I *think* I have everything covered if we use the config shown below (full doc: https://sourceware.org/gdb/wiki/proposed/git-hooks/UsersGuide). It handles: - dynamic computation of the email list (by attached email_to.py script). - rejection of merge commits on branch master and all GDB release branches. - filing of commits in bugzilla. - irker notification |[hooks] | from-domain = sourceware.org | mailinglist = /git/binutils-gdb.git/hooks-bin/email_to.py | | # We do not want to force a maximum line length in commit | # revision logs, as they get in the way of copy-pasting | # debugging session, error messages, logs, etc. | max-rh-line-length = 0 | | # Reject merge commits on a certain number of branches: | # - on master: We request that people rebase their changes | # before pushing instead (merge commits tend to confuse | # git newcommers). | # - on GDB release branches: There is a high risk that a merge | # commit is a merge from master into the branch, which would | # bring a lot more than what the user probably meant to push. | # Request that the user cherry-pick his changes. | reject-merge-commits = refs/heads/master, refs/heads/gdb-.* | | # The style checker, applied to the contents of each file being | # modified. | style-checker = /git/binutils-gdb.git/hooks-bin/style_checker | | # The URL where we can inspect the commit, inserted in the commit | # notification email, and also copy sent to the file-commit-cmd. | commit-url = "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=%(rev)s" | | # Do not send emails for the following branches (unofficial | # third-party branches). | # FIXME: It would be nice to move the "hjl" branches to /user/. | no-emails = /refs/heads/hjl/.*, /refs/heads/user/.* | | # Send a copy to bugzilla if a commit has a PR number in it. | file-commit-cmd = /sourceware/infra/bin/email-to-bugzilla -G "gdb binutils" | # The script that calls the irker (IRC notification of new | # commits). | post-receive-hook = /git/binutils-gdb.git/hooks-bin/post-receive Note that this also introduces a "style checker", which is a script called to check the contents of each and every file being modfied by a given commit. At the moment, the script does nothing, but we could imagine checking things like copyright headers, style violations; and this checking can very well be dependent on the type of file. But that's a project on its own for which I won't have time. If someone implements something, I'll integrate it! Timeline: ========= If people are happy with the above, when do we want to transition. I feel the best time for me would be during the Xmas break. How do people feel about me doing the transition sometime after Monday Dec 29th? Reminder: hooks sources at https://gitorious.org/githooks -- Joel --qtZFehHsKgwS5rPz Content-Type: text/x-python; charset=us-ascii Content-Disposition: attachment; filename="email_to.py" Content-length: 1243 #! /usr/bin/env python import sys ML_MAP = {'bfd': 'bfd-cvs@example.com', 'gdb': 'gdb-cvs@example.com', } OWNER_MAP = ( # BFD file... ('bfd/', 'bfd'), ('binutils/', 'bfd'), ('opcode/', 'bfd'), ('cpu/', 'bfd'), ('elfcpp/', 'bfd'), ('gas/', 'bfd'), ('gold/', 'bfd'), ('gprof/', 'bfd'), ('include/', 'bfd'), ('ld/', 'bfd'), ('opcodes/', 'bfd'), # GDB files... ('gdb/', 'gdb'), ('readline/', 'gdb'), ('sim/', 'gdb'), ) EVERYONE = set(ML_MAP[ml_key] for ml_key in ML_MAP) def ml_from_filename(filename): for (path, ml_key) in OWNER_MAP: if filename.startswith(path): return ML_MAP[ml_key] # Not found in map, it is a common file. return EVERYONE result = set() for filename in sys.stdin: ml = ml_from_filename(filename) if isinstance(ml, basestring): result.add(ml) else: result.update(ml) if len(result) >= len(EVERYONE): # We have iterated over enough entries to know already # that we have selected all possible recipients. So # stop now. break if not result: # No files given, return EVERYONE result = EVERYONE print '\n'.join(sorted(result)) --qtZFehHsKgwS5rPz--