GNU bug report logs -
#66138
[PATCH 1/4] etc/committer: Do not recompute changes when there are no definitions.
Previous Next
Reported by: Ricardo Wurmus <rekado <at> elephly.net>
Date: Thu, 21 Sep 2023 14:14:01 UTC
Severity: normal
Tags: patch
Done: Ricardo Wurmus <rekado <at> elephly.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sun, 24 Sep 2023 14:12:28 +0200
with message-id <87r0mn6a81.fsf <at> elephly.net>
and subject line Re: [PATCH 1/4] etc/committer: Do not recompute changes when there are no definitions.
has caused the debbugs.gnu.org bug report #66138,
regarding [PATCH 1/4] etc/committer: Do not recompute changes when there are no definitions.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
66138: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66138
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
* etc/committer.scm.in (main): Reuse previously computed changes if there are
no changes to the number of definitions.
---
etc/committer.scm.in | 75 +++++++++++++++++++++++---------------------
1 file changed, 40 insertions(+), 35 deletions(-)
diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index e7f1ca8c45..cc3b572710 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -388,41 +388,46 @@ (define (main . args)
(unless (eqv? 0 (status:exit-val (close-pipe port)))
(error "Cannot commit"))))
(usleep %delay))
- definitions))
+ definitions)
- ;; Changes.
- (for-each
- (match-lambda
- ((new old . hunks)
- (for-each (lambda (hunk)
- (let ((port (open-pipe* OPEN_WRITE
- "git" "apply"
- "--cached"
- "--unidiff-zero")))
- (hunk->patch hunk port)
- (unless (eqv? 0 (status:exit-val (close-pipe port)))
- (error "Cannot apply")))
- (usleep %delay))
- hunks)
- (define copyright-line
- (any (lambda (line) (and=> (string-prefix? "+;;; Copyright ©" line)
- (const line)))
- (hunk-diff-lines (first hunks))))
- (cond
- (copyright-line
- (add-copyright-line copyright-line))
- (else
- (let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" "-")))
- (change-commit-message* (hunk-file-name (first hunks))
- old new)
- (change-commit-message* (hunk-file-name (first hunks))
- old new
- port)
- (usleep %delay)
- (unless (eqv? 0 (status:exit-val (close-pipe port)))
- (error "Cannot commit")))))))
- ;; XXX: we recompute the hunks here because previous
- ;; insertions lead to offsets.
- (new+old+hunks (diff-info))))))
+ ;; Changes.
+ (for-each
+ (match-lambda
+ ((new old . hunks)
+ (for-each (lambda (hunk)
+ (let ((port (open-pipe* OPEN_WRITE
+ "git" "apply"
+ "--cached"
+ "--unidiff-zero")))
+ (hunk->patch hunk port)
+ (unless (eqv? 0 (status:exit-val (close-pipe port)))
+ (error "Cannot apply")))
+ (usleep %delay))
+ hunks)
+ (define copyright-line
+ (any (lambda (line) (and=> (string-prefix? "+;;; Copyright ©" line)
+ (const line)))
+ (hunk-diff-lines (first hunks))))
+ (cond
+ (copyright-line
+ (add-copyright-line copyright-line))
+ (else
+ (let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" "-")))
+ (change-commit-message* (hunk-file-name (first hunks))
+ old new)
+ (change-commit-message* (hunk-file-name (first hunks))
+ old new
+ port)
+ (usleep %delay)
+ (unless (eqv? 0 (status:exit-val (close-pipe port)))
+ (error "Cannot commit")))))))
+ (new+old+hunks (match definitions
+ ('() changes) ;reuse
+ (_
+ ;; XXX: we recompute the hunks here because previous
+ ;; insertions lead to offsets.
+ (let-values (((definitions changes)
+ (partition hunk-type (diff-info))))
+ changes)))))))))
(apply main (cdr (command-line)))
base-commit: 4bdb8bd2674c2b630626be43a5cd3c2b65401b52
--
2.41.0
[Message part 3 (message/rfc822, inline)]
I just pushed this series.
--
Ricardo
This bug report was last modified 1 year and 238 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.