mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
etc/committer: Do not recompute changes when there are no definitions.
* etc/committer.scm.in (main): Reuse previously computed changes if there are no changes to the number of definitions.
This commit is contained in:
parent
0792d99466
commit
0836af9a3b
1 changed files with 40 additions and 35 deletions
|
@ -388,7 +388,7 @@ (define* (change-commit-message* file-name old new #:rest rest)
|
||||||
(unless (eqv? 0 (status:exit-val (close-pipe port)))
|
(unless (eqv? 0 (status:exit-val (close-pipe port)))
|
||||||
(error "Cannot commit"))))
|
(error "Cannot commit"))))
|
||||||
(usleep %delay))
|
(usleep %delay))
|
||||||
definitions))
|
definitions)
|
||||||
|
|
||||||
;; Changes.
|
;; Changes.
|
||||||
(for-each
|
(for-each
|
||||||
|
@ -421,8 +421,13 @@ (define copyright-line
|
||||||
(usleep %delay)
|
(usleep %delay)
|
||||||
(unless (eqv? 0 (status:exit-val (close-pipe port)))
|
(unless (eqv? 0 (status:exit-val (close-pipe port)))
|
||||||
(error "Cannot commit")))))))
|
(error "Cannot commit")))))))
|
||||||
|
(new+old+hunks (match definitions
|
||||||
|
('() changes) ;reuse
|
||||||
|
(_
|
||||||
;; XXX: we recompute the hunks here because previous
|
;; XXX: we recompute the hunks here because previous
|
||||||
;; insertions lead to offsets.
|
;; insertions lead to offsets.
|
||||||
(new+old+hunks (diff-info))))))
|
(let-values (((definitions changes)
|
||||||
|
(partition hunk-type (diff-info))))
|
||||||
|
changes)))))))))
|
||||||
|
|
||||||
(apply main (cdr (command-line)))
|
(apply main (cdr (command-line)))
|
||||||
|
|
Loading…
Reference in a new issue