[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/magit 4255895657 10/17: magit-git-wash: Always keep error
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/magit 4255895657 10/17: magit-git-wash: Always keep error output |
Date: |
Tue, 1 Apr 2025 09:38:05 -0400 (EDT) |
branch: elpa/magit
commit 4255895657373bea08fcb775d1552ac652f1253c
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-git-wash: Always keep error output
Remove the variable `magit--git-wash-keep-error' which previously could
be used to disable that. The variable was added in [1: 78a979fde5] and
its value was changed to t in [2: 76253bda0d]. This has generally held
up well enough to be permanently enabled.
Function `magit--git-wash', which was added in [1: 78a979fde5], can be
used in cases where the section should be canceled in case of an error.
Also extend the docstrings of these two functions.
1: 2023-03-18 78a979fde52815242b165f083d171259db28e0b4
Support displaying errors that occur when washing a section
2: 2024-11-15 76253bda0d05d252e118e56955447b6e4d6c0535
magit--git-wash-keep-error: Enable by default
---
lisp/magit-diff.el | 2 +-
lisp/magit-git.el | 24 ++++++++++++++++--------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index eb904fab58..7e87fa5b33 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2240,7 +2240,7 @@ keymap is the parent of their keymaps."
(magit--git-wash #'magit-diff-wash-diffs
(if (member "--no-index" args)
'wash-anyway
- (or keep-error magit--git-wash-keep-error))
+ (or keep-error t))
cmd args)))
(defun magit-diff--maybe-add-stat-arguments (args)
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 41587bc73e..d432531d21 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -543,18 +543,26 @@ a section in the respective process buffer."
(apply #'magit-git-insert args)
(split-string (buffer-string) "\0" t)))
-(defvar magit--git-wash-keep-error t)
-
(defun magit-git-wash (washer &rest args)
- "Execute Git with ARGS, inserting washed output at point.
-Actually first insert the raw output at point. If there is no
-output, call `magit-cancel-section'. Otherwise temporarily narrow
-the buffer to the inserted text, move to its beginning, and then
-call function WASHER with ARGS as its sole argument."
+ "Execute git with ARGS, inserting washed output at point.
+
+First insert the raw output at point. If there is no output, call
+`magit-cancel-section'. Otherwise temporarily narrow the buffer to
+the inserted text, move to its beginning, and finally call function
+WASHER with ARGS as its sole argument.
+
+If git exits with a non-zero exit status, apply the `error' face to
+the error message, instead of calling WASHER. To instead cancel the
+section use `magit--git-wash'."
(declare (indent 1))
- (apply #'magit--git-wash washer magit--git-wash-keep-error args))
+ (apply #'magit--git-wash washer t args))
(defun magit--git-wash (washer keep-error &rest args)
+ "Execute git with ARGS, inserting washed output at point.
+
+Like `magit-git-wash' but if KEEP-ERROR is nil and an error occurs, also
+insert standard error. If KEEP-ERROR is `wash-anyway', insert and wash
+standard output even in case of an error."
(declare (indent 2))
(setq args (flatten-tree args))
(let ((beg (point))
- [nongnu] elpa/magit updated (bec296e8d7 -> 993cdf0aa4), Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 4255895657 10/17: magit-git-wash: Always keep error output,
Jonas Bernoulli <=
- [nongnu] elpa/magit 6aec967ee4 01/17: Move Ido kludges to a new package magit-ido, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit aa0166c92a 02/17: magit-submodule.el: Do not declare x-stretch-cursor, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 40220d6fff 05/17: magit-git-{lines, items}: Fix docstring pastos, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 69cd033e82 08/17: magit-git-debug: Rename value all to include-success, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 88464b5363 09/17: magit-git-debug: Add docstring, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 64e69ea809 11/17: magit--git-insert: Do not return empty string as error message, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 0a74fb0a60 15/17: magit-{stage, unstage}-buffer-file: Move definitions, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 65437016c2 06/17: magit-git-executable: Change name of output buffer, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit ce9f1a5427 07/17: magit-toggle-git-debug: Fix key binding in docstring, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 895e4feced 13/17: magit-file-{rename, untrack, delete}: Autoload, Jonas Bernoulli, 2025/04/01