From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: gnu-patches back log Date: Sat, 11 Mar 2017 22:30:50 +0100 Message-ID: <871su35wmt.fsf@gnu.org> References: <87inof5w20.fsf@dustycloud.org> <20170226111029.GA19050@mail.thebird.nl> <87poi4rd1m.fsf@dustycloud.org> <20170228062531.GA647@mail.thebird.nl> <874lz6qt4y.fsf@gnu.org> <58BE9D24.7030702@crazy-compilers.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmobI-0004e3-Pt for guix-devel@gnu.org; Sat, 11 Mar 2017 16:30:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmobF-0003k9-M3 for guix-devel@gnu.org; Sat, 11 Mar 2017 16:30:56 -0500 In-Reply-To: <58BE9D24.7030702@crazy-compilers.com> (Hartmut Goebel's message of "Tue, 7 Mar 2017 12:44:36 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Hartmut, Hartmut Goebel skribis: > Am 06.03.2017 um 17:14 schrieb Ludovic Court=C3=A8s: >> add Reviewed-by tags > > Can git add this automatically? Otherwise it would mean additional > manual work. Actually Git already distinguishes between committer and author, so you=E2=80=99re probably right. Based on that, the attached Guile-Git program gives the number of patches committed on behalf of someone else, and=E2=80=A6 [drum roll] we g= et: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,pp (sort (reviewers repo) reviewer<) $6 =3D ((0 . "Nikita Karetnikov") (0 . "Cyril Roelandt") (0 . "John Darrington") (0 . "Jason Self") (0 . "Federico Beffa") (0 . "rekado") (0 . "Taylan Ulrich Bay=C4=B1rl=C4=B1/Kammer") (0 . "Tom=C3=A1=C5=A1 =C4=8Cech") (0 . "Paul van der Walt") (0 . "Ben J. Woodcroft") (0 . "Alex Sassmannshausen") (0 . "Julien Lepiller") (1 . "Andy Wingo") (2 . "cyril") (2 . "Manolis Ragkousis") (2 . "Roel Janssen") (2 . "Tobias Geerinckx-Rice") (6 . "Christopher Allan Webber") (9 . "Hartmut Goebel") (13 . "Danny Milosavljevic") (17 . "Mathieu Lirzin") (29 . "Eric Bavier") (36 . "Andreas Enge") (38 . "David Craven") (40 . "Ben Woodcroft") (51 . "David Thompson") (52 . "Kei Kebreau") (68 . "=E5=AE=8B=E6=96=87=E6=AD=A6") (81 . "Mark H Weaver") (88 . "Alex Kost") (94 . "Ricardo Wurmus") (99 . "Marius Bakke") (101 . "Efraim Flashner") (336 . "Leo Famulari") (641 . "Ludovic Court=C3=A8s")) --8<---------------cut here---------------end--------------->8--- Not sure if it=E2=80=99s 100% accurate, but it should be a good approximati= on. To those with a 1-digit number, please take a look at and try to beat your fellow hackers! :-) Ludo=E2=80=99. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=reviewers.scm Content-Description: the code (use-modules (git) (git repository) (git reference) (git oid) (git tag) (git commit) (git structs) ;signature-email, etc. (srfi srfi-1) (srfi srfi-26) (ice-9 match) (ice-9 vlist)) (define commit-author* (compose signature-name commit-author)) (define commit-committer* (compose signature-name commit-committer)) (define-syntax-rule (false-if-git-error exp) (catch 'git-error (lambda () exp) (const #f))) (define* (fold-commits proc seed repo #:key (start (reference-target (repository-head repo))) end) "Call PROC on each commit of REPO, starting at START (an OID), and until END if specified." (let loop ((commit (commit-lookup repo start)) (result seed)) (let ((parent (false-if-git-error (commit-parent commit)))) (if parent (if (and end (oid=? (commit-id parent) end)) (proc parent result) (loop parent (proc parent result))) result)))) (define (reviewers repo) "Return a list of review count/committer pairs." (define vhash (fold-commits (lambda (commit result) (if (string=? (commit-author* commit) (commit-committer* commit)) result (vhash-cons (commit-committer* commit) #t result))) vlist-null repo)) (define committers (delete-duplicates (fold-commits (lambda (commit result) (cons (commit-committer* commit) result)) '() repo))) (map (lambda (committer) (cons (vhash-fold* (lambda (_ count) (+ 1 count)) 0 committer vhash) committer)) committers)) (define (reviewer< r1 r2) (match r1 ((count1 . name1) (match r2 ((count2 . name2) (< count1 count2)))))) (libgit2-init!) (define repo (repository-open ".")) --=-=-=--