From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YC54DX6sGWRvQwEASxT56A (envelope-from ) for ; Tue, 21 Mar 2023 14:09:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AA9rDX6sGWTEFQAA9RJhRA (envelope-from ) for ; Tue, 21 Mar 2023 14:09:18 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AFF51DAE4 for ; Tue, 21 Mar 2023 14:09:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pebjc-0005QG-9K; Tue, 21 Mar 2023 09:09:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pebja-0005Pz-LN for guix-patches@gnu.org; Tue, 21 Mar 2023 09:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pebja-00072w-Ct for guix-patches@gnu.org; Tue, 21 Mar 2023 09:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pebja-0006N9-8e for guix-patches@gnu.org; Tue, 21 Mar 2023 09:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59318] [PATCH] etc: committer: Add --package-directory flag. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Mar 2023 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59318 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 59318@debbugs.gnu.org, Antero Mejr Received: via spool by 59318-submit@debbugs.gnu.org id=B59318.167940410824429 (code B ref 59318); Tue, 21 Mar 2023 13:09:02 +0000 Received: (at 59318) by debbugs.gnu.org; 21 Mar 2023 13:08:28 +0000 Received: from localhost ([127.0.0.1]:57888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pebj1-0006Lw-6o for submit@debbugs.gnu.org; Tue, 21 Mar 2023 09:08:27 -0400 Received: from mail-qv1-f45.google.com ([209.85.219.45]:33446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pebiz-0006Lg-4k for 59318@debbugs.gnu.org; Tue, 21 Mar 2023 09:08:26 -0400 Received: by mail-qv1-f45.google.com with SMTP id m6so9837548qvq.0 for <59318@debbugs.gnu.org>; Tue, 21 Mar 2023 06:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679404099; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=2K7wBn55qDy2k3cxshcNU62B4Ik9XzVwFf9HX79WUIQ=; b=jF0tfEVfaKdX1CJMLBPmdZa7MCCks6ZnWOPRk3Nih3lQkUSPrfXWET9rrIfjaLFmCd D0dxwkGivzwTlmnHlHCFfc+45dMXomhjk1YzzZfgfc8xTdoIYayR2tLV5LL6lP0rJOil +V4kWC4GCxGzIJFDuse9LvPWqh4hQ6oxRGkvdXbmMKDQc1IUHNgwvj4bmGD50uQCxf+1 aW/BRHBJ7lWOlP24LflZC7BYSpkJzpNUvO08oJfEKJPRPc67Qd43EDL1p5nDJAMhXT5c ncb1/KdrzoJnMxpz4QFREhYl78JnSo3stSp3ZAdQIjrvhVfYzC1VXRWm41Ifln4eAl29 GWfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679404099; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2K7wBn55qDy2k3cxshcNU62B4Ik9XzVwFf9HX79WUIQ=; b=aLgdpIhawWtI+XB4U8y7QucSFzrZg5LLk7iII/2GnHgmwf0bALMzgB3rQttUGYmRF1 F+z8+MxAV4QTz0gDkrX4PN6+t4AavT4CeiLyYX+y+WtcKupszRC/x0LRKV5F29otBGTW 8AvR6MaVQJOVq4Zbheqlrb6azi+rivngr1Hy8zpu6BPI8ShIFV0ttozohawYJNQeAtPQ zyBXpZ32A1GNK9V1jNnrLiIgnDrJYcnRB4xhmGmDzIE9GGJBYqZYqCjPDrbKRSHHyiwt FRiOeKVV2fVj90ikFIUDlGT+64OrKKK55yqfkL/ccIAfp0LK8W+xconMk9QGF1tq5apk ewlA== X-Gm-Message-State: AO0yUKUcj7RtJz2vyFHksvGjQg39LdobuP6WZ0p567EYCME5jpX7uvGR gFKGydRNrz3ffTyn8xXk/MCkbhA/Xq9TUA== X-Google-Smtp-Source: AK7set9L/6n82Jsh1H2V+2bSUvwWkP9zudxmpzMsEcEFINSNCdGp4e+9Gv501BLEWiZZQ3hytSWQpA== X-Received: by 2002:a05:6214:d64:b0:5ac:b644:b4c5 with SMTP id 4-20020a0562140d6400b005acb644b4c5mr4273489qvs.47.1679404099284; Tue, 21 Mar 2023 06:08:19 -0700 (PDT) Received: from hurd (dsl-10-130-195.b2b2c.ca. [72.10.130.195]) by smtp.gmail.com with ESMTPSA id v20-20020ac873d4000000b003b86b088755sm8364855qtp.15.2023.03.21.06.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 06:08:19 -0700 (PDT) From: Maxim Cournoyer References: <20221116185853.13957-1-antero@mailbox.org> <5fea7098e0e3a0452d6f99a62a2ece83e93c640e.camel@ist.tugraz.at> Date: Tue, 21 Mar 2023 09:08:17 -0400 In-Reply-To: <5fea7098e0e3a0452d6f99a62a2ece83e93c640e.camel@ist.tugraz.at> (Liliana Marie Prikler's message of "Thu, 17 Nov 2022 13:27:39 +0100") Message-ID: <87a606s14u.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679404157; a=rsa-sha256; cv=none; b=LKOXUGPs58IPOFB/S1gCjsM/BAqfjt3ms7RAGuCP/N3hiV30lYSL8eaubq7bBml6LXerkv m0ysfQYyCLySTv8rTM3Et+by1ryWa0OpTcpikcimwERBBiIROAYFc1kkT824ztrwxn9EY6 pHi/z7hxN9DvZLHZw/C1S86qwJbf9PvUQdXH3vxuTqE9RMUeJqKYvQKBHhEfdwfrM7Dcy6 tGCkeSvr/Jpla6iUy0bTyfP5WjycxF2k0cZmschRHGr4/zzYBcDINmd7erNpr5pZ70Cs43 tNaHFQY4/CXhs9anWbl1uKRQPY84IqlZuJkCqhOvbT58RjJaCAWpK8WZ87+g0w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=jF0tfEVf; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679404157; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2K7wBn55qDy2k3cxshcNU62B4Ik9XzVwFf9HX79WUIQ=; b=L4UlZwnLd7JCeWa66x5ECt2xGgYuFlI8zE39alt3lLpxgXklsvmh0wMIU5QHCdnItOMmys 6b/TpnSIXOdho42+/sGUQVp3EJP9Oi+lTJdGE1GD+q8F5LW5ikDLGk+IB12UgnS0t7rJkf cueAj1TLriw3XeyrXYeZtnJRbASrJC1fuuZwnSyuQEt983QGaPO8+3OrurxUJe+VKzLknB uBP30r0/YHcQYs7aSxmKXSdCeqUpvifXOXVswaCAyiFKrdnzU3IbOi/htubhqt0CAzKZxL rPI2bqQsHrHknYb27trjsWSoKgr/5MyolSqaiP3hjl43N63QFCVwI471vOK5rg== X-Migadu-Spam-Score: 5.75 X-Spam-Score: 5.75 X-Migadu-Queue-Id: AFF51DAE4 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=jF0tfEVf; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-TUID: /gbphnvOEKCV Hello Antero, Liliana Marie Prikler writes: > Am Mittwoch, dem 16.11.2022 um 18:58 +0000 schrieb Antero Mejr: >> * etc/committer.scm.in (main)[pkg-dir]: New variable. >> (main): Use it. >> (diff-info)[package-dir]: New argument. >> (change-commit-message)[package-dir]: New argument. >> (add-commit-message)[package-dir]: New argument. >> (remove-commit-message)[package-dir]: New argument. >> (custom-commit-message)[package-dir]: New argument. > This could be simplified to (diff-info, change-commit-message, ...): > Honour package-dir. >> --- >> Make the hard-coded "gnu" part of the package directory path into a >> flag. >> This allows committer.scm to be used for channels where the package >> directory is not "gnu". > Note that instead of forwarding as you did, you could also make > package-dir a parameter and (parameterize ) it. This has the advantage > that you don't need to forward it in places where it's not immediately > clear to be relevant. >>=20 >> =C2=A0etc/committer.scm.in | 46 +++++++++++++++++++++++++++-------------= -- >> -- >> =C2=A01 file changed, 28 insertions(+), 18 deletions(-) >>=20 >> diff --git a/etc/committer.scm.in b/etc/committer.scm.in >> index e7f1ca8c45..13021891aa 100755 >> --- a/etc/committer.scm.in >> +++ b/etc/committer.scm.in >> @@ -129,7 +129,7 @@ (define* (hunk->patch hunk #:optional (port >> (current-output-port))) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= file-name file-name file-name file-name >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (string-join (hunk-diff-lines hunk) "")))) >> =C2=A0 >> -(define (diff-info) >> +(define (diff-info package-dir) >> =C2=A0=C2=A0 "Read the diff and return a list of values." >> =C2=A0=C2=A0 (let ((port (open-pipe* OPEN_READ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 "git" "diff-files" >> @@ -138,7 +138,7 @@ (define (diff-info) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ;; new definitions with changes to >> existing >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ;; definitions. >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 "--unified=3D1" >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 "--" "gnu"))) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 "--" package-dir))) >> =C2=A0=C2=A0=C2=A0=C2=A0 (define (extract-line-number line-tag) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (abs (string->number >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (car (string-split line-tag #\,))))) >> @@ -221,7 +221,8 @@ (define (new-sexp hunk) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (+= (lines-to-first-change hunk) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (hunk-new-line-number hunk)))))) >> =C2=A0 >> -(define* (change-commit-message file-name old new #:optional (port >> (current-output-port))) >> +(define* (change-commit-message file-name old new package-dir >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #:optional (port (current-output- >> port))) >> =C2=A0=C2=A0 "Print ChangeLog commit message for changes between OLD and= NEW." >> =C2=A0=C2=A0 (define (get-values expr field) >> =C2=A0=C2=A0=C2=A0=C2=A0 (match ((xpath:sxpath `(// ,field quasiquote *)= ) expr) >> @@ -247,8 +248,8 @@ (define version >> =C2=A0=C2=A0=C2=A0=C2=A0 (and=3D> ((xpath:sxpath '(// version *any*)) ne= w) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 first= )) >> =C2=A0=C2=A0 (format port >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "gnu: ~a: Update= to ~a.~%~%* ~a (~a): Update to ~a.~%" >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 variable-name ve= rsion file-name variable-name version) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "~a: ~a: Update = to ~a.~%~%* ~a (~a): Update to ~a.~%" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 package-dir vari= able-name version file-name variable-name >> version) >> =C2=A0=C2=A0 (for-each (lambda (field) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (let ((old-values (get-values old field)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (new-values (get-values ne= w field))) >> @@ -272,21 +273,22 @@ (define version >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (listify added)))))))))) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= '(inputs propagated-inputs native-inputs))) >> =C2=A0 >> -(define* (add-commit-message file-name variable-name >> +(define* (add-commit-message file-name variable-name package-dir >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 #:optional (port (current-output- >> port))) >> =C2=A0=C2=A0 "Print ChangeLog commit message for a change to FILE-NAME a= dding a >> =C2=A0definition." >> -=C2=A0 (format port "gnu: Add ~a.~%~%* ~a (~a): New variable.~%" >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 variable-name fi= le-name variable-name)) >> +=C2=A0 (format port "~a: Add ~a.~%~%* ~a (~a): New variable.~%" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 package-dir vari= able-name file-name variable-name)) >> =C2=A0 >> -(define* (remove-commit-message file-name variable-name >> +(define* (remove-commit-message file-name variable-name package-dir >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #:optional (port (current-out= put- >> port))) >> =C2=A0=C2=A0 "Print ChangeLog commit message for a change to FILE-NAME r= emoving >> a >> =C2=A0definition." >> -=C2=A0 (format port "gnu: Remove ~a.~%~%* ~a (~a): Delete variable.~%" >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 variable-name fi= le-name variable-name)) >> +=C2=A0 (format port "~a: Remove ~a.~%~%* ~a (~a): Delete variable.~%" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 package-dir vari= able-name file-name variable-name)) >> =C2=A0 >> =C2=A0(define* (custom-commit-message file-name variable-name message >> changelog >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 package-dir >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #:optional (port (current-out= put- >> port))) >> =C2=A0=C2=A0 "Print custom commit message for a change to VARIABLE-NAME = in >> FILE-NAME, using >> =C2=A0MESSAGE as the commit message and CHANGELOG as the body of the >> ChangeLog >> @@ -301,7 +303,7 @@ (define (changelog-has-location? changelog) >> =C2=A0 >> =C2=A0=C2=A0 (let* ((message (trim message)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (changelog (if ch= angelog (trim changelog) message)) >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (message/f (format #f = "gnu: ~a: ~a." variable-name >> message)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (message/f (format #f = "~a: ~a: ~a." package-dir variable- >> name message)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (changelog/f (if = (changelog-has-location? changelog) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (format #f "* ~a (~a)~a." >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 file-name variabl= e-name changelog) > You're repeating the same work with each message style. IMHO it would > make more sense to have a procedure or syntax that prepends it instead. >> @@ -349,16 +351,23 @@ (define (new+old+hunks hunks) >> =C2=A0(define %delay 1000) >> =C2=A0 >> =C2=A0(define (main . args) >> +=C2=A0 (define pkg-dir >> +=C2=A0=C2=A0=C2=A0 (match args >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (("--package-directory" pkg-dir ...) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (begin (set! args (cddr args)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (car pkg-dir))) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (_ "gnu"))) >> + > Using a proper option grammar in combination with getopt-long is > probably a better idea ;) >> =C2=A0=C2=A0 (define* (change-commit-message* file-name old new #:rest r= est) >> =C2=A0=C2=A0=C2=A0=C2=A0 (let ((changelog #f)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (match args >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((or (message changelog= ) (message)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (apply custom-com= mit-message >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 file-name (second old) message changelog rest)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 file-name (second old) message changelog pkg-dir >> rest)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (_ >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (apply change-commit-m= essage file-name old new rest))))) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (apply change-commit-m= essage file-name old new pkg-dir >> rest))))) >> =C2=A0 >> -=C2=A0 (match (diff-info) >> +=C2=A0 (match (diff-info pkg-dir) >> =C2=A0=C2=A0=C2=A0=C2=A0 (() >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (display "Nothing to be done.\n" (current= -error-port))) >> =C2=A0=C2=A0=C2=A0=C2=A0 (hunks >> @@ -373,7 +382,7 @@ (define* (change-commit-message* file-name old >> new #:rest rest) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (commit-message-proc= (match (hunk-type hunk) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ('addition add-commit- >> message) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ('removal remove-commit- >> message)))) >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (com= mit-message-proc (hunk-file-name hunk) variable- >> name) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (com= mit-message-proc (hunk-file-name hunk) variable-name >> pkg-dir) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (let ((port (open-pipe* OPEN_WRITE >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "git"= "apply" >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "--ca= ched" >> @@ -383,7 +392,8 @@ (define* (change-commit-message* file-name old >> new #:rest rest) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (error "Cannot apply"))) >> =C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" >> "-"))) >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (commit-message-proc (hunk-file-name hunk) variable- >> name port) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (commit-message-proc (hunk-file-name hunk) variable- >> name pkg-dir >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 port) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (usleep %delay) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (unless (eqv? 0 (status:exit-val (close-pipe port))) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (error "Cannot commit")))) >> @@ -423,6 +433,6 @@ (define copyright-line >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (error "Cannot commit"))))))) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; XXX: we recompute the hunks here= because previous >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; insertions lead to offsets. >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (new+old+hunks (diff-info)))))) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (new+old+hunks (diff-info pkg-dir)))))) >> =C2=A0 >> =C2=A0(apply main (cdr (command-line))) > Cheers Gentle ping :-). Could you please address the above review comments and send a v2? --=20 Thanks, Maxim