{"thread":{"id":"3674","subject":"[PATCH 2/3] git.el: Get the default user name and email from the repository config.","startedAt":"2006-03-19T09:05:48Z","lastAt":"2006-03-19T09:05:48Z","messageCount":1,"participants":["Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"17663","messageId":"87wteqby8j.fsf@wine.dyndns.org","threadId":"3674","inReplyTo":null,"subject":"[PATCH 2/3] git.el: Get the default user name and email from the repository config.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2006-03-19T09:05:48Z","receivedAt":"2006-03-19T09:05:48Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"If user name or email are not set explicitly, get them from the\nuser.name and user.email configuration values before falling back to\nthe Emacs defaults.\n\nSigned-off-by: Alexandre Julliard <julliard@winehq.org>\n\n---\n\n contrib/emacs/git.el |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\nac4b54cc4019abdb92cd0fbbf7c644976227fea0\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex cf650da..5496a1b 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -59,14 +59,14 @@\n \n (defcustom git-committer-name nil\n   \"User name to use for commits.\n-The default is to fall back to `add-log-full-name' and then `user-full-name'.\"\n+The default is to fall back to the repository config, then to `add-log-full-name' and then to `user-full-name'.\"\n   :group 'git\n   :type '(choice (const :tag \"Default\" nil)\n                  (string :tag \"Name\")))\n \n (defcustom git-committer-email nil\n   \"Email address to use for commits.\n-The default is to fall back to `add-log-mailing-address' and then `user-mail-address'.\"\n+The default is to fall back to the git repository config, then to `add-log-mailing-address' and then to `user-mail-address'.\"\n   :group 'git\n   :type '(choice (const :tag \"Default\" nil)\n                  (string :tag \"Email\")))\n@@ -203,6 +203,7 @@ The default is to fall back to `add-log-\n   \"Return the name to use as GIT_COMMITTER_NAME.\"\n   ; copied from log-edit\n   (or git-committer-name\n+      (git-repo-config \"user.name\")\n       (and (boundp 'add-log-full-name) add-log-full-name)\n       (and (fboundp 'user-full-name) (user-full-name))\n       (and (boundp 'user-full-name) user-full-name)))\n@@ -211,6 +212,7 @@ The default is to fall back to `add-log-\n   \"Return the email address to use as GIT_COMMITTER_EMAIL.\"\n   ; copied from log-edit\n   (or git-committer-email\n+      (git-repo-config \"user.email\")\n       (and (boundp 'add-log-mailing-address) add-log-mailing-address)\n       (and (fboundp 'user-mail-address) (user-mail-address))\n       (and (boundp 'user-mail-address) user-mail-address)))\n@@ -268,6 +270,11 @@ The default is to fall back to `add-log-\n   (git-get-string-sha1\n    (git-call-process-env-string nil \"rev-parse\" rev)))\n \n+(defun git-repo-config (key)\n+  \"Retrieve the value associated to KEY in the git repository config file.\"\n+  (let ((str (git-call-process-env-string nil \"repo-config\" key)))\n+    (and str (car (split-string str \"\\n\")))))\n+\n (defun git-symbolic-ref (ref)\n   \"Wrapper for the git-symbolic-ref command.\"\n   (let ((str (git-call-process-env-string nil \"symbolic-ref\" ref)))\n-- \n1.2.4.g9c5a7\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"}]}