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/trampver.el | |
parent | 55f3f21b39389263d707b091d7e1b45d295a149c (diff) | |
download | emacs-a062fc4137ff195fe269076cda07a61c2e1a8012.tar.gz |
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/trampver.el')
-rw-r--r-- | lisp/net/trampver.el | 28 |
1 files changed, 17 insertions, 11 deletions
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")) |