bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51497: 29.0.50; (vc-print-log) broken over TRAMP


From: Dmitry Gutov
Subject: bug#51497: 29.0.50; (vc-print-log) broken over TRAMP
Date: Wed, 3 Nov 2021 05:00:49 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Michael,

On 31.10.2021 19:05, Michael Albinus wrote:
(defun vc-git--program-version ()
   (let ((current
         (if (file-remote-p default-directory)
             (with-connection-local-variables
              (and (local-variable-p 'vc-git--program-version)
                   vc-git--program-version))
           vc-git--program-version)))
     (or current
        (let ((version-string
                (vc-git--run-command-string nil "version")))
           (setq version-string
                (if (and version-string
                         ;; Git for Windows appends ".windows.N" to the
                         ;; numerical version reported by Git.
                         (string-match
                           "git version 
\\([0-9.]+\\)\\(\\.windows\\.[0-9]+\\)?$"
                           version-string))
                     (match-string 1 version-string)
                   "0"))
          (if (file-remote-p default-directory)
              (let ((profile (gensym "connection-local-profile-")))
                (connection-local-set-profile-variables
                 profile `((vc-git--program-version . ,version-string))) ;
                (connection-local-set-profiles
                 (connection-local-criteria-for-default-directory) profile))
            (setq vc-git--program-version version-string))
          version-string))))

I wonder if we could have some helper that is more succinct. One that didn't require the client code to auto-generate the profile name, for instance.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]