[Top][All Lists]

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

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

From: Morgan . J . Smith
Subject: [bug#47658] [PATCH] etc/committer: Use git plumbing instead of porcelain
Date: Thu, 8 Apr 2021 12:16:35 -0400

From: Morgan Smith <>

* etc/
(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/ | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/etc/ b/etc/
index 7991dc7430..1f19ccfd6d 100755
--- a/etc/
+++ b/etc/
@@ -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"
                           ;; 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)))
          (((definitions changes)

reply via email to

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