all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: Patches for Emacs 25.2
Date: Mon, 2 Jan 2017 21:43:39 +0300	[thread overview]
Message-ID: <27731f0d-8eb5-9647-f4b6-19141b1aa9bd@gmail.com> (raw)
In-Reply-To: <87zij96480.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

Hello, Michael.

Just to be clear - we're talking about the current master. That one does 
not work. My original patch, or your rewrite in this thread works.

So here's what happens.

1. Msg-file has a local name as its value. Let's say I'm trying to 
commit into repository /pscp:server:/home/user/git-test/. 
Make-nearby-temp-file creates a file 
"/pscp:server:/home/user/git-test/git-msg23408zHn". Msg-file becomes 
"/home/user/git-test/git-msg23408zHn".

2. We concat a git command like "git commit 
/home/user/git-test/git-msg23408zHn". No problem here, since we need a 
local name.

3. (write-region (car args) nil msg-file) happens and it fails, because 
local name "/home/user/git-test/git-msg23408zHn" expands to 
"c:/home/user/git-test/git-msg23408Ncz" which is a file on a local 
machine and it does not exist.

The fix would be having absolute name for 
msg-file(/pscp:server:/home/user/git-test/git-msg23408zHn) and then 
using (or (file-remote-p msg-file 'localname)  msg-file) for git commit. 
Everywhere else we need the absolute name.

I've attached those changes as patch.

-- 
Best Regards,
Nikolay Kudryavtsev


[-- Attachment #2: remote-vc-git-master-fixed.patch --]
[-- Type: text/plain, Size: 1159 bytes --]

diff --git lisp/vc/vc-git.el lisp/vc/vc-git.el
index c670280..616c150 100644
--- lisp/vc/vc-git.el
+++ lisp/vc/vc-git.el
@@ -707,14 +707,16 @@
           ;; message.  Handle also remote files.
           (if (eq system-type 'windows-nt)
               (let ((default-directory (file-name-directory file1)))
-                (file-local-name (make-nearby-temp-file "git-msg"))))))
+                (make-nearby-temp-file "git-msg")))))
     (cl-flet ((boolean-arg-fn
                (argument)
                (lambda (value) (when (equal value "yes") (list argument)))))
       ;; When operating on the whole tree, better pass "-a" than ".", since "."
       ;; fails when we're committing a merge.
       (apply 'vc-git-command nil 0 (if only files)
-             (nconc (if msg-file (list "commit" "-F" msg-file)
+             (nconc (if msg-file (list "commit" "-F"
+                                       (or (file-remote-p msg-file 'localname)
+                                           msg-file))
                       (list "commit" "-m"))
                     (let ((args
                            (log-edit-extract-headers

  reply	other threads:[~2017-01-02 18:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  7:09 Patches for Emacs 25.2 Michael Albinus
2016-10-18  7:24 ` Eli Zaretskii
2016-10-18  7:47   ` Michael Albinus
2016-10-18  8:09     ` Nikolay Kudryavtsev
2016-10-18  8:25       ` Michael Albinus
2016-10-18  9:24         ` Eli Zaretskii
2016-10-18 11:05           ` Nikolay Kudryavtsev
2016-10-18 11:29             ` Eli Zaretskii
2016-10-18 11:59               ` Nikolay Kudryavtsev
2016-10-18 12:32                 ` Michael Albinus
2016-10-18 14:38                   ` Eli Zaretskii
2016-11-07  0:08                   ` Dmitry Gutov
2016-11-07  9:01                     ` Michael Albinus
2016-11-07  9:36                       ` Dmitry Gutov
2016-11-07 10:31                         ` Michael Albinus
2016-11-07 10:39                           ` Dmitry Gutov
2016-11-07 10:58                             ` Michael Albinus
2016-11-19 23:03                               ` Dmitry Gutov
2016-11-20 15:34                                 ` file-local-name (was: Patches for Emacs 25.2) Michael Albinus
2016-11-19 23:04                             ` Patches for Emacs 25.2 Dmitry Gutov
2016-11-20  8:49                               ` Michael Albinus
2016-12-31  4:20                               ` Nikolay Kudryavtsev
2016-12-31 11:32                                 ` Dmitry Gutov
2016-12-31 11:40                                   ` Eli Zaretskii
2016-12-31 11:44                                     ` Dmitry Gutov
2017-01-02 10:21                                   ` Nikolay Kudryavtsev
2017-01-02 10:32                                     ` Dmitry Gutov
2017-01-02 12:22                                       ` Michael Albinus
2017-01-02 18:43                                         ` Nikolay Kudryavtsev [this message]
2017-01-02 18:54                                           ` Michael Albinus
2017-01-02 19:08                                             ` Dmitry Gutov
2017-01-02 19:56                                               ` Michael Albinus
2017-01-02 20:08                                                 ` Dmitry Gutov
2017-01-02 19:54                                           ` Michael Albinus
2017-01-02 20:52                                             ` Nikolay Kudryavtsev
2017-01-02 19:13                   ` Dmitry Gutov
2016-10-18  9:13     ` Eli Zaretskii
2016-10-18  9:55       ` Michael Albinus
2016-10-18 10:05         ` Eli Zaretskii
2016-10-18 11:24           ` Michael Albinus
2016-10-18 11:30             ` Eli Zaretskii
2016-12-16  0:05 ` Dmitry Gutov
2016-12-16  8:10   ` Eli Zaretskii
2016-12-16 18:33     ` Dmitry Gutov
2016-12-16 21:11       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27731f0d-8eb5-9647-f4b6-19141b1aa9bd@gmail.com \
    --to=nikolay.kudryavtsev@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.