all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#47658] [PATCH] etc/committer: Use git plumbing instead of porcelain
@ 2021-04-08 16:16 Morgan.J.Smith
       [not found] ` <BYAPR05MB40237A7A54E58396AE0A954BC5749@BYAPR05MB4023.namprd05.prod.outlook.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Morgan.J.Smith @ 2021-04-08 16:16 UTC (permalink / raw)
  To: 47658; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@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





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

* bug#47658: Fwd: [PATCH] etc/committer: Use git plumbing instead of porcelain
       [not found] ` <BYAPR05MB40237A7A54E58396AE0A954BC5749@BYAPR05MB4023.namprd05.prod.outlook.com>
@ 2021-04-12 19:46   ` Ricardo Wurmus
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Wurmus @ 2021-04-12 19:46 UTC (permalink / raw)
  To: Morgan Smith; +Cc: 47658-done


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




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

end of thread, other threads:[~2021-04-12 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 16:16 [bug#47658] [PATCH] etc/committer: Use git plumbing instead of porcelain Morgan.J.Smith
     [not found] ` <BYAPR05MB40237A7A54E58396AE0A954BC5749@BYAPR05MB4023.namprd05.prod.outlook.com>
2021-04-12 19:46   ` bug#47658: Fwd: " Ricardo Wurmus

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.