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

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

[nongnu] elpa/git-commit 314b24cb40 4/4: git-commit-self-ident: Demote e


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 314b24cb40 4/4: git-commit-self-ident: Demote errors rather than ignoring them
Date: Mon, 21 Feb 2022 01:58:08 -0500 (EST)

branch: elpa/git-commit
commit 314b24cb405fa14880c2affc447c1d1fae22f893
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    git-commit-self-ident: Demote errors rather than ignoring them
    
    Some of the "insert header" commands use git-commit-self-ident to get
    a name and email.  git-commit-self-ident wraps its git-config calls in
    ignore-errors and then proceeds to fallback values.
    
    user.name and user.email are something that all Git users should
    configure, and git-commit will complain ("Please tell me who you are
    ...").  Use with-demoted-errors instead of ignore-errors so that
    there's a message about these variables being unset.  This change
    means that errors won't be caught when debug-on-error is non-nil, but,
    given git-commit-self-ident is called only by "insert header"
    commands, that seems appropriate.
    
    Re: magit/with-editor#106
---
 lisp/git-commit.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index 11ebb380b7..17594bcf55 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -866,7 +866,7 @@ Save current message first."
 (defun git-commit-self-ident ()
   (list (or (getenv "GIT_AUTHOR_NAME")
             (getenv "GIT_COMMITTER_NAME")
-            (ignore-errors
+            (with-demoted-errors "Error running 'git config user.name': %S"
               (car (process-lines
                     (git-commit-executable) "config" "user.name")))
             user-full-name
@@ -874,7 +874,7 @@ Save current message first."
         (or (getenv "GIT_AUTHOR_EMAIL")
             (getenv "GIT_COMMITTER_EMAIL")
             (getenv "EMAIL")
-            (ignore-errors
+            (with-demoted-errors "Error running 'git config user.email': %S"
               (car (process-lines
                     (git-commit-executable) "config" "user.email")))
             (read-string "Email: "))))



reply via email to

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