Subject: bug#33394: 27.0.50; trampver cannot determine repository version

From: Michael Albinus <[email-masked]>
Date: Thu, 15 Nov 2018 12:40:17 +0100

Geoffrey Ferrari <[email-masked]> writes:

Hi Geoffrey,

> The issue can be traced to the definition of tramp-repository-branch
> in
> trampver.el. This calls:
>
> (emacs-repository-get-branch
> (locate-dominating-file (locate-library "tramp") ".git"))
>
> However, (locate-dominating-file (locate-library "tramp") ".git")
> evaluates to nil, meaning that above is equivalent to
> (emacs-repository-get-branch nil).
>
> This causes the function emacs-repository-get-branch (in version.el)
> to
> rely on the variable source-directory i.e. which references the source
> directory where the emacs
> binary was built, which of course does not exist on an end user's
> system.

Yes. However, the initial value of tramp-repository-branch is

--8<---------------cut here---------------start------------->8---
  (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")))))
--8<---------------cut here---------------end--------------->8---

I'm wondering why you see an error, although the code is wrapped by
`ignore-errors'.

Best regards, Michael.