diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2018-11-10 16:03:12 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2018-11-10 16:03:12 +0100 |
commit | a062fc4137ff195fe269076cda07a61c2e1a8012 (patch) | |
tree | c1ca66b9f322fd9db69baaa1e0c47444931527d7 /lisp/net | |
parent | 55f3f21b39389263d707b091d7e1b45d295a149c (diff) | |
download | emacs-a062fc4137ff195fe269076cda07a61c2e1a8012.tar.gz emacs-a062fc4137ff195fe269076cda07a61c2e1a8012.tar.bz2 emacs-a062fc4137ff195fe269076cda07a61c2e1a8012.zip |
Provide branch information for both Emacs and Tramp (Bug#33328)
* doc/lispref/intro.texi (Version Info):
Document `emacs-repository-version' and `emacs-repository-branch'.
* etc/NEWS: Mention `emacs-repository-branch'.
* lisp/loadup.el: Initialize `emacs-repository-branch'.
* lisp/version.el (emacs-repository-branch): New variable.
(emacs-repository-branch-git, emacs-repository-get-branch):
New defuns.
* lisp/mail/emacsbug.el (report-emacs-bug):
Insert `emacs-repository-branch'.
* lisp/net/tramp.el (tramp-get-local-gid):
Use `group-name' if available.
(tramp-debug-message):
* lisp/net/tramp-cmds.el (tramp-bug): Report also
`tramp-repository-branch' and `tramp-repository-version'.
* lisp/net/trampver.el (tramp-repository-branch)
(tramp-repository-version): New defconst.
(tramp-repository-get-version): Remove.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp-cmds.el | 5 | ||||
-rw-r--r-- | lisp/net/tramp.el | 11 | ||||
-rw-r--r-- | lisp/net/trampver.el | 28 |
3 files changed, 27 insertions, 17 deletions
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 456300e7662..3c8f182ae97 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -198,8 +198,9 @@ This includes password cache, file cache, connection cache, buffers." ;; In rare cases, it could contain the password. So we make it nil. tramp-password-save-function) (reporter-submit-bug-report - tramp-bug-report-address ; to-address - (format "tramp (%s)" tramp-version) ; package name and version + tramp-bug-report-address ; to-address + (format "tramp (%s %s/%s)" ; package name and version + tramp-version tramp-repository-branch tramp-repository-version) (sort (delq nil (mapcar (lambda (x) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 44d66404f15..e8d535e85ed 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1609,10 +1609,13 @@ ARGUMENTS to actually emit the message (if applicable)." ";; Emacs: %s Tramp: %s -*- mode: outline; -*-" emacs-version tramp-version)) (when (>= tramp-verbose 10) - (insert - (format - "\n;; Location: %s Git: %s" - (locate-library "tramp") (tramp-repository-get-version))))) + (let ((tramp-verbose 0)) + (insert + (format + "\n;; Location: %s Git: %s/%s" + (locate-library "tramp") + (or tramp-repository-branch "") + (or tramp-repository-version "")))))) (unless (bolp) (insert "\n")) ;; Timestamp. diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index de76788cc0e..f93e5380849 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -38,17 +38,23 @@ (defconst tramp-bug-report-address "tramp-devel@gnu.org" "Email address to send bug reports to.") -(defun tramp-repository-get-version () - "Try to return as a string the repository revision of the Tramp sources." - (let ((dir (locate-dominating-file (locate-library "tramp") ".git"))) - (when dir - (with-temp-buffer - (let ((default-directory (file-name-as-directory dir))) - (and (zerop - (ignore-errors - (call-process "git" nil '(t nil) nil "rev-parse" "HEAD"))) - (not (zerop (buffer-size))) - (replace-regexp-in-string "\n" "" (buffer-string)))))))) +(defconst tramp-repository-branch + (ignore-errors + ;; Suppress message from `emacs-repository-get-branch'. + (let ((inhibit-message t)) + ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. + (with-no-warnings + (emacs-repository-get-branch + (locate-dominating-file (locate-library "tramp") ".git"))))) + "The repository branch of the Tramp sources.") + +(defconst tramp-repository-version + (ignore-errors + ;; Suppress message from `emacs-repository-get-version'. + (let ((inhibit-message t)) + (emacs-repository-get-version + (locate-dominating-file (locate-library "tramp") ".git")))) + "The repository revision of the Tramp sources.") ;; Check for Emacs version. (let ((x (if (not (string-lessp emacs-version "24.1")) |