emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit 2ed5a06d08 3/4: magit-toggle-git-debug: New com


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 2ed5a06d08 3/4: magit-toggle-git-debug: New command
Date: Mon, 2 May 2022 17:58:20 -0400 (EDT)

branch: elpa/git-commit
commit 2ed5a06d089021f6f5c88203174bda89a1a70b5e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-toggle-git-debug: New command
---
 docs/magit.org    | 27 +++++++++++++++++++++++++++
 docs/magit.texi   | 27 +++++++++++++++++++++++++++
 lisp/magit-git.el | 11 +++++++++++
 3 files changed, 65 insertions(+)

diff --git a/docs/magit.org b/docs/magit.org
index b894855dbb..b5f489903b 100644
--- a/docs/magit.org
+++ b/docs/magit.org
@@ -1849,6 +1849,9 @@ sections are available.  There is one additional command.
   the context of some unexpected behavior has to be judged on a case
   by case basis.
 
+  The command ~magit-toggle-git-debug~ changes the value of this
+  variable.
+
 - Variable: magit-process-extreme-logging ::
 
   This option controls whether ~magit-process-file~ logs to the
@@ -9090,6 +9093,30 @@ issue.
   If you run Magit from its Git repository, then you should be able to
   use ~make emacs-Q~ instead of the output of this command.
 
+- Key: M-x magit-toggle-verbose-refresh ::
+
+  This command toggles whether additional git errors are reported.
+
+  Magit basically calls git for one of these two reasons: for
+  side-effects or to do something with its standard output.
+
+  When git is run for side-effects then its output, including error
+  messages, go into the process buffer which is shown when using ~$~.
+
+  When git's output is consumed in some way, then it would be too
+  expensive to also insert it into this buffer, but when this
+  option is non-nil and git returns with a non-zero exit status,
+  then at least its standard error is inserted into this buffer.
+
+  This is only intended for debugging purposes.  Do not enable this
+  permanently, that would negatively affect performance.  Also note
+  that just because git exits with a non-zero exit status and prints
+  an error message that usually doesn't mean that it is an error as
+  far as Magit is concerned, which is another reason we usually hide
+  these error messages.  Whether some error message is relevant in
+  the context of some unexpected behavior has to be judged on a case
+  by case basis.
+
 - Key: M-x magit-toggle-verbose-refresh ::
 
   This command toggles whether Magit refreshes buffers verbosely.
diff --git a/docs/magit.texi b/docs/magit.texi
index b28d823a4f..779e02d88e 100644
--- a/docs/magit.texi
+++ b/docs/magit.texi
@@ -2388,6 +2388,9 @@ far as Magit is concerned, which is another reason we 
usually hide
 these error messages.  Whether some error message is relevant in
 the context of some unexpected behavior has to be judged on a case
 by case basis.
+
+The command @code{magit-toggle-git-debug} changes the value of this
+variable.
 @end defvar
 
 @defvar magit-process-extreme-logging
@@ -11089,6 +11092,30 @@ issue lays with Magit or something else.
 If you run Magit from its Git repository, then you should be able to
 use @code{make emacs-Q} instead of the output of this command.
 
+@item @kbd{M-x magit-toggle-verbose-refresh}
+@findex magit-toggle-verbose-refresh
+This command toggles whether additional git errors are reported.
+
+Magit basically calls git for one of these two reasons: for
+side-effects or to do something with its standard output.
+
+When git is run for side-effects then its output, including error
+messages, go into the process buffer which is shown when using @code{$}.
+
+When git's output is consumed in some way, then it would be too
+expensive to also insert it into this buffer, but when this
+option is non-nil and git returns with a non-zero exit status,
+then at least its standard error is inserted into this buffer.
+
+This is only intended for debugging purposes.  Do not enable this
+permanently, that would negatively affect performance.  Also note
+that just because git exits with a non-zero exit status and prints
+an error message that usually doesn't mean that it is an error as
+far as Magit is concerned, which is another reason we usually hide
+these error messages.  Whether some error message is relevant in
+the context of some unexpected behavior has to be judged on a case
+by case basis.
+
 @item @kbd{M-x magit-toggle-verbose-refresh}
 @findex magit-toggle-verbose-refresh
 This command toggles whether Magit refreshes buffers verbosely.
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 82617a246e..b238fe5bc2 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -284,8 +284,19 @@ these error messages.  Whether some error message is 
relevant in
 the context of some unexpected behavior has to be judged on a case
 by case basis.
 
+The command `magit-toggle-git-debug' changes the value of this
+variable.
+
 Also see `magit-process-extreme-logging'.")
 
+(defun magit-toggle-git-debug ()
+  "Toggle whether additional git errors are reported.
+See info node `(magit)Debugging Tools' for more information."
+  (interactive)
+  (setq magit-git-debug (not magit-git-debug))
+  (message "Additional reporting of Git errors %s"
+           (if magit-git-debug "enabled" "disabled")))
+
 (defvar magit--refresh-cache nil)
 
 (defmacro magit--with-refresh-cache (key &rest body)



reply via email to

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