From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 15 17:04:12 2020 Received: (at submit) by debbugs.gnu.org; 15 Jun 2020 21:04:12 +0000 Received: from localhost ([127.0.0.1]:47601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkwGy-0001Uu-SF for submit@debbugs.gnu.org; Mon, 15 Jun 2020 17:04:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:38998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkwGv-0001UX-Vz for submit@debbugs.gnu.org; Mon, 15 Jun 2020 17:04:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkwGr-0005og-HL for guix-patches@gnu.org; Mon, 15 Jun 2020 17:04:01 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:50398) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkwGo-0004D4-MG for guix-patches@gnu.org; Mon, 15 Jun 2020 17:03:57 -0400 Received: (qmail 13757 invoked by uid 1009); 15 Jun 2020 23:03:51 +0200 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25843. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.044095 secs); 15 Jun 2020 21:03:51 -0000 Received: from unknown (HELO localhost.localdomain) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with AES256-SHA encrypted SMTP; 15 Jun 2020 23:03:51 +0200 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= To: guix-patches@gnu.org Subject: [PATCH] channels: Allow specifying per-channel --allow-downgrades in the channel file Date: Mon, 15 Jun 2020 23:03:43 +0200 Message-Id: <20200615210343.18964-1-kuba@kadziolka.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=37.59.186.212; envelope-from=kuba@kadziolka.net; helo=pat.zlotemysli.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/15 17:03:52 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/channels.scm () [allow-unrelated?, allow-downgrade?]: New fields. (ensure-forward-channel-update): Handle the fields appropriately. --- guix/channels.scm | 5 +++++ 1 file changed, 5 insertions(+) Some time ago, guix pull started verifying that the new commit follows the old commit in the git history. That's good in the common case, but unfortunately, this broke my workflow [0]. Namely, I maintain a branch of the guix repository on which I cherry-pick some commits that haven't hit master yet. I rebase it onto master frequently. It gets tiring to have to specify --allow-downgrades when pulling, so I added a way of specifying it in the channels file. As a bonus, it's more granular. If this is the right approach, I'll add some docs. Also, is there a test that exercises this function? [0]: https://xkcd.com/1172/ diff --git a/guix/channels.scm b/guix/channels.scm index 84c47fc0d0..17c4f3750c 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,8 @@ (url channel-url) (branch channel-branch (default "master")) (commit channel-commit (default #f)) + (allow-unrelated? channel-allow-unrelated? (default #f)) + (allow-downgrade? channel-allow-downgrade? (default #f)) (location channel-location (default (current-source-location)) (innate))) @@ -245,6 +248,8 @@ This procedure implements a channel update policy meant to be used as a (match relation ('ancestor #t) ('self #t) + ((? (const (channel-allow-unrelated? channel)) 'unrelated) #t) + ((? (const (channel-allow-downgrade? channel)) 'descendant) #t) (_ (raise (make-compound-condition (condition -- 2.26.2