GNU bug report logs - #47658
[PATCH] etc/committer: Use git plumbing instead of porcelain

Previous Next

Package: guix-patches;

Reported by: Morgan.J.Smith <at> outlook.com

Date: Thu, 8 Apr 2021 16:33:01 UTC

Severity: normal

Tags: patch

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47658 in the body.
You can then email your comments to 47658 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47658; Package guix-patches. (Thu, 08 Apr 2021 16:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Morgan.J.Smith <at> outlook.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 08 Apr 2021 16:33:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: guix-patches <at> gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Subject: [PATCH] etc/committer: Use git plumbing instead of porcelain
Date: Thu,  8 Apr 2021 12:16:35 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* etc/committer.scm.in
(diff-info): Use git diff-files instead of git diff
(old-sexp): Use git cat-file instead of git show
(main): Add newline to displayed message
---
 etc/committer.scm.in | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index 7991dc7430..1f19ccfd6d 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -89,7 +89,7 @@ LINE-NO in PORT."
 (define (diff-info)
   "Read the diff and return a list of <hunk> values."
   (let ((port (open-pipe* OPEN_READ
-                          "git" "diff"
+                          "git" "diff-files"
                           "--no-prefix"
                           ;; Only include one context line to avoid lumping in
                           ;; new definitions with changes to existing
@@ -153,8 +153,9 @@ LINE-NO in PORT."
 corresponding to the top-level definition containing the staged changes."
   ;; TODO: We can't seek with a pipe port...
   (let* ((port (open-pipe* OPEN_READ
-                           "git" "show" (string-append "HEAD:"
-                                                       (hunk-file-name hunk))))
+                           "git" "cat-file" "-p" (string-append
+                                                  "HEAD:"
+                                                  (hunk-file-name hunk))))
          (contents (get-string-all port)))
     (close-pipe port)
     (call-with-input-string contents
@@ -253,7 +254,7 @@ modifying."
 (define (main . args)
   (match (diff-info)
     (()
-     (display "Nothing to be done." (current-error-port)))
+     (display "Nothing to be done.\n" (current-error-port)))
     (hunks
      (let-values
          (((definitions changes)
-- 
2.31.1





Reply sent to Ricardo Wurmus <rekado <at> elephly.net>:
You have taken responsibility. (Mon, 12 Apr 2021 19:48:01 GMT) Full text and rfc822 format available.

Notification sent to Morgan.J.Smith <at> outlook.com:
bug acknowledged by developer. (Mon, 12 Apr 2021 19:48:01 GMT) Full text and rfc822 format available.

Message #10 received at 47658-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Cc: 47658-done <at> debbugs.gnu.org
Subject: Re: Fwd: [PATCH] etc/committer: Use git plumbing instead of porcelain
Date: Mon, 12 Apr 2021 21:46:55 +0200
> Subject: [PATCH] etc/committer: Use git plumbing instead of porcelain
> Date: Thu,  8 Apr 2021 12:16:35 -0400
> From: Morgan.J.Smith <at> outlook.com
> To: guix-patches <at> gnu.org
> CC: Morgan Smith <Morgan.J.Smith <at> outlook.com>
>
> From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
>
> * etc/committer.scm.in
> (diff-info): Use git diff-files instead of git diff
> (old-sexp): Use git cat-file instead of git show
> (main): Add newline to displayed message

I broke this up into two commits and pushed them.

Thank you!

-- 
Ricardo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 May 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.