diff options
| author | Morgan Smith <Morgan.J.Smith@outlook.com> | 2021-04-08 12:16:35 -0400 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2021-04-12 21:42:15 +0200 |
| commit | d375eddda0b407b29ce0f7d29a582623cef20a89 (patch) | |
| tree | 55b747cdef9e3097a4f1d0bb86b5d1106b661836 | |
| parent | d14f21389c7faeb8a763ebbcf1b8aa1ba4deade9 (diff) | |
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>
| -rwxr-xr-x | etc/committer.scm.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/committer.scm.in b/etc/committer.scm.in index 801b5d195ea..cc713dcdcdd 100755 --- a/etc/committer.scm.in +++ b/etc/committer.scm.in | |||
| @@ -89,8 +89,7 @@ LINE-NO in PORT." | |||
| 89 | (define (diff-info) | 89 | (define (diff-info) |
| 90 | "Read the diff and return a list of <hunk> values." | 90 | "Read the diff and return a list of <hunk> values." |
| 91 | (let ((port (open-pipe* OPEN_READ | 91 | (let ((port (open-pipe* OPEN_READ |
| 92 | "git" "diff" | 92 | "git" "diff-files" |
| 93 | "--no-color" | ||
| 94 | "--no-prefix" | 93 | "--no-prefix" |
| 95 | ;; Only include one context line to avoid lumping in | 94 | ;; Only include one context line to avoid lumping in |
| 96 | ;; new definitions with changes to existing | 95 | ;; new definitions with changes to existing |
| @@ -154,8 +153,9 @@ LINE-NO in PORT." | |||
| 154 | corresponding to the top-level definition containing the staged changes." | 153 | corresponding to the top-level definition containing the staged changes." |
| 155 | ;; TODO: We can't seek with a pipe port... | 154 | ;; TODO: We can't seek with a pipe port... |
| 156 | (let* ((port (open-pipe* OPEN_READ | 155 | (let* ((port (open-pipe* OPEN_READ |
| 157 | "git" "show" (string-append "HEAD:" | 156 | "git" "cat-file" "-p" (string-append |
| 158 | (hunk-file-name hunk)))) | 157 | "HEAD:" |
| 158 | (hunk-file-name hunk)))) | ||
| 159 | (contents (get-string-all port))) | 159 | (contents (get-string-all port))) |
| 160 | (close-pipe port) | 160 | (close-pipe port) |
| 161 | (call-with-input-string contents | 161 | (call-with-input-string contents |
