Commit fdf31e5d authored by Michael Albinus's avatar Michael Albinus

Improve Tramp traces.

* lisp/net/trampver.el (tramp-repository-get-version): New defun.

* lisp/net/tramp.el (tramp-debug-message): Use it.
parent b65be6c5
......@@ -1433,7 +1433,12 @@ ARGUMENTS to actually emit the message (if applicable)."
";; %sEmacs: %s Tramp: %s -*- mode: outline; -*-"
(if (featurep 'sxemacs) "SX" (if (featurep 'xemacs) "X" "GNU "))
emacs-version tramp-version)))
emacs-version tramp-version))
(when (>= tramp-verbose 10)
"\n;; Location: %s Git: %s"
(locate-library "tramp") (tramp-repository-get-version)))))
(unless (bolp)
(insert "\n"))
;; Timestamp.
......@@ -38,6 +38,18 @@
(defconst tramp-bug-report-address ""
"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 (funcall 'locate-dominating-file (locate-library "tramp") ".git")))
(when dir
(let ((default-directory (file-name-as-directory dir)))
(and (zerop
(call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
(not (zerop (buffer-size)))
(replace-regexp-in-string "\n" "" (buffer-string))))))))
;; Check for (X)Emacs version.
(let ((x (if (or (>= emacs-major-version 22)
(and (featurep 'xemacs)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment