cjohansson / emacs-ssh-deploy

A deployment plugin via Tramp for Emacs.
GNU General Public License v3.0
154 stars 6 forks source link

Doing directory difference from local-root generates wrong remote-root if it's piped via sudo? #63

Closed cjohansson closed 5 years ago

cjohansson commented 5 years ago

.dir-locals.el contents ((nil . (

    (ssh-deploy-root-local . "/home/christian/Sites/mysite/")
    (ssh-deploy-root-remote . "/ssh:christian@vps.com|sudo:web@vps.com:/home/christian/public_html/mysite/")

    )))

Directory A: /home/christian/Sites/mysite/

Actual Directory B: /sudo:web@vps.com:/home/christian/public_html/mysite Expected Directory B: "/ssh:christian@vps.com|sudo:web@vps.com:/home/christian/public_html/mysite/

cjohansson commented 5 years ago

I have debugged this and there are two causes for this:

  1. (expand-file-name "" "/my-root/") evaluates to /my-root (notice the lack of trailing slash), should use concat in (ssh-deploy-diff-handler)
  2. remote-root is altered via (file-truename) in (ssh-deploy-diff-directories), this destroys the pipe file-name. Skip (file-truename) there