summaryrefslogtreecommitdiff
path: root/guix/git.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2019-12-31 11:04:51 +0100
committerMathieu Othacehe <m.othacehe@gmail.com>2019-12-31 11:04:51 +0100
commitce9383c090fff90acb3a555d0ccfe12d791fef17 (patch)
tree7b9cce156799486b94e4f3e55b03831638e73465 /guix/git.scm
parent91be09de61c277d0f1b26cefcefcd0a7fae2e00d (diff)
parentfc4eb87dc45b169e3912c73bbf60cb8ce76b7c7c (diff)
downloadguix-patches-ce9383c090fff90acb3a555d0ccfe12d791fef17.tar
guix-patches-ce9383c090fff90acb3a555d0ccfe12d791fef17.tar.gz
Merge remote-tracking branch 'master' into core-updates.
Diffstat (limited to 'guix/git.scm')
-rw-r--r--guix/git.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/guix/git.scm b/guix/git.scm
index d7dddde3a7..83af596ef5 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -347,10 +347,11 @@ Log progress and checkout info to LOG-PORT."
;;; Commit difference.
;;;
-(define (commit-closure commit)
- "Return the closure of COMMIT as a set."
+(define* (commit-closure commit #:optional (visited (setq)))
+ "Return the closure of COMMIT as a set. Skip commits contained in VISITED,
+a set, and adjoin VISITED to the result."
(let loop ((commits (list commit))
- (visited (setq)))
+ (visited visited))
(match commits
(()
visited)
@@ -360,15 +361,16 @@ Log progress and checkout info to LOG-PORT."
(loop (append (commit-parents head) tail)
(set-insert head visited)))))))
-(define (commit-difference new old)
+(define* (commit-difference new old #:optional (excluded '()))
"Return the list of commits between NEW and OLD, where OLD is assumed to be
-an ancestor of NEW.
+an ancestor of NEW. Exclude all the commits listed in EXCLUDED along with
+their ancestors.
Essentially, this computes the set difference between the closure of NEW and
that of OLD."
(let loop ((commits (list new))
(result '())
- (visited (commit-closure old)))
+ (visited (commit-closure old (list->setq excluded))))
(match commits
(()
(reverse result))