guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: etc/committer: Use git plumbing instead of porcelain.


From: guix-commits
Subject: 01/02: etc/committer: Use git plumbing instead of porcelain.
Date: Mon, 12 Apr 2021 15:42:54 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit d375eddda0b407b29ce0f7d29a582623cef20a89
Author: Morgan Smith <Morgan.J.Smith@outlook.com>
AuthorDate: Thu Apr 8 12:16:35 2021 -0400

    etc/committer: Use git plumbing instead of porcelain.
    
    * etc/committer.scm.in (diff-info): Use "git diff-files" instead of "git 
diff".
    (old-sexp): Use "git cat-file" instead of "git show".
    
    Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
---
 etc/committer.scm.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index 801b5d1..cc713dc 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -89,8 +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"
-                          "--no-color"
+                          "git" "diff-files"
                           "--no-prefix"
                           ;; Only include one context line to avoid lumping in
                           ;; new definitions with changes to existing
@@ -154,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]