unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41882] [PATCH] channels: Allow specifying per-channel --allow-downgrades in the channel file
@ 2020-06-15 21:03 Jakub Kądziołka
  2020-06-17  9:27 ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Jakub Kądziołka @ 2020-06-15 21:03 UTC (permalink / raw)
  To: 41882

* guix/channels.scm (<channel>)
  [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 <ludo@gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;;
 ;;; 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





^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-06-19 20:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-15 21:03 [bug#41882] [PATCH] channels: Allow specifying per-channel --allow-downgrades in the channel file Jakub Kądziołka
2020-06-17  9:27 ` Ludovic Courtès
2020-06-17 18:50   ` Jakub Kądziołka
2020-06-18 11:59     ` Ludovic Courtès
2020-06-18 23:52   ` Jakub Kądziołka
2020-06-19  0:19     ` [bug#41882] Guix configuration file? zimoun
2020-06-19  7:39       ` Ludovic Courtès
2020-06-19  7:52     ` [bug#41882] [PATCH] channels: Allow specifying per-channel --allow-downgrades in the channel file Ludovic Courtès
2020-06-19 12:25       ` Jakub Kądziołka
2020-06-19 20:26         ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).