(format
";; %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)
+ (insert
+ (format
+ "\n;; Location: %s Git: %s"
+ (locate-library "tramp") (tramp-repository-get-version)))))
(unless (bolp)
(insert "\n"))
;; Timestamp.
(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 (funcall '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))))))))
+
;; Check for (X)Emacs version.
(let ((x (if (or (>= emacs-major-version 22)
(and (featurep 'xemacs)