all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
@ 2022-12-12 16:31 Sam Steingold
  2022-12-12 18:29 ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Steingold @ 2022-12-12 16:31 UTC (permalink / raw)
  To: 60011

I run Emacs locally (macosx laptop) and edit remote (Amazon Linux "cloud
desktop") files using tramp (scp).
I can commit files using vc/git just fine.
However, when I edit *vc-diff* and hit C-v v v (vc-next-action), and
then edit the commit message abd hit C-c C-c, I get this error:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "Failed (status 128): git --no-pager apply --cached...")
  signal(error ("Failed (status 128): git --no-pager apply --cached..."))
  error("Failed (%s): %s" "status 128" "git --no-pager apply --cached /var/folders/20/__3t...")
  vc-do-command("*vc*" 0 "git" "/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/g..." "--no-pager" "apply" "--cached")
  apply(vc-do-command "*vc*" 0 "git" "/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/g..." ("--no-pager" "apply" "--cached"))
  vc-git-command(nil 0 "/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/g..." "apply" "--cached")
  vc-git-checkin(nil #("Summary: TEE: split pairs_mx into make_da2mt_mx an..." ...
  vc-git-checkin-patch(#("diff --git a/TEE/lucindex.py b/TEE/lucindex.py\nind..." ...
  apply(vc-git-checkin-patch (#("diff --git a/TEE/lucindex.py b/TEE/lucindex.py\nind..." ...
  vc-call-backend(Git checkin-patch #("diff --git a/TEE/lucindex.py b/TEE/lucindex.py\nind..." ...
  #f(compiled-function (files comment) #<bytecode 0x1dfec5afeaefa0a0>) ...
  vc-finish-logentry()
  funcall-interactively(vc-finish-logentry)
  call-interactively(vc-finish-logentry)
  log-edit-done()
  funcall-interactively(log-edit-done)
  call-interactively(log-edit-done nil nil)
  command-execute(log-edit-done)
--8<---------------cut here---------------end--------------->8---


and *vc* says

--8<---------------cut here---------------start------------->8---
error: can't open patch '/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/git-patchAWaImM': No such file or directory
--8<---------------cut here---------------end--------------->8---

this is a _local_ directory - it exists on the laptop but not on the
"cloud desktop".




In GNU Emacs 30.0.50 (build 2, x86_64-apple-darwin21.6.0, NS
 appkit-2113.60 Version 12.6.1 (Build 21G217)) of 2022-12-12 built on
 3c22fb11fdab.ant.amazon.com
Repository revision: 5325d815af43a36ea8571851e272c3d39bc19252
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.6.1

Configured using:
 'configure --with-imagemagick --with-mailutils --with-ns
 PKG_CONFIG_PATH='

Configured features:
ACL GIF GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY
KQUEUE NS PDUMPER PNG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM
ZLIB

Important settings:
  value of $LC_MESSAGES: C
  value of $LANG: C
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  shell-dirtrack-mode: t
  bug-reference-prog-mode: t
  pyvenv-mode: t
  global-edit-server-edit-mode: t
  server-mode: t
  winner-mode: t
  which-function-mode: t
  url-handler-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort bbdb-message mailalias cookie1 mail-extr gnus-msg emacsbug
cl-print debug backtrace log-edit vc-src vc-sccs vc-svn vc-cvs vc-rcs
log-view pcvs-util smerge-mode diff misearch multi-isearch skeleton
dabbrev url-http url-auth url-gw nsm ein-jupyter ein-dev ein-notebook
ein-python-send ein-traceback ein-pytools ein-pager ein-completer
ein-notification ein-scratchsheet ein-worksheet poly-ein quail polymode
poly-lock polymode-base polymode-weave polymode-export polymode-compat
polymode-methods polymode-core polymode-classes eieio-custom eieio-base
color ein-kill-ring ein-cell ein-shared-output ein-output-area
ein-kernelinfo ein-kernel ein-ipdb ein-events ein-websocket websocket
bindat ein-file ein-node ein-notebooklist shortdoc ein-contents-api
ein-query ein-log ein-classes ein-core request autorevert anaphora
ein-utils deferred dash cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs ein display-line-numbers
add-log vc-hg vc-bzr tramp-cache time-stamp tramp-sh tramp
tramp-loaddefs trampver tramp-integration tramp-compat shell ls-lisp
remember score-mode conf-mode bug-reference flyspell ispell
display-fill-column-indicator org-element org-persist org-id org-refile
avl-tree oc-basic ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc
ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime
gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util gnus-group gnus-undo gnus-start
gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo
parse-time gnus-spec gnus-int gnus-range message sendmail mailcap
yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums gmm-utils mailheader gnus-win ol-docview doc-view filenotify
jka-compr image-mode exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi
org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src ob-comint org-pcomplete pcomplete org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval
org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs
find-func cal-x view cal-china cal-bahai cal-islam holidays
holiday-loaddefs bbdb-anniv cal-iso cal-hebrew lunar cal-julian solar
cal-dst appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
org-version org-compat org-macs format-spec vc-dir ewoc vc sh-script
smie executable vc-git vc-dispatcher company-oddmuse company-keywords
company-etags company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-template company-cmake company-bbdb
yasnippet-snippets cl-extra yasnippet flymake-proc flymake thingatpt
company-capf company help-fns radix-tree help-mode elpy elpy-rpc pyvenv
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util cus-start elpy-shell elpy-profile elpy-django s
elpy-refactor diff-mode easy-mmode ido hideshow grep compile files-x
etags fileloop generator xref python rx project compat compat-macs
treesit comint ansi-osc ansi-color dired-aux midnight dired
dired-loaddefs cus-edit pp warnings icons gnus nnheader gnus-util
text-property-search time-date mail-utils range mm-util mail-prsvr
wid-edit bbdb-mua bbdb-com crm mailabbrev bbdb bbdb-site timezone
modus-vivendi-theme modus-themes pcase edit-server advice server winner
ring which-func imenu url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp
byte-compile url-vars help-at-pt desktop frameset cl-loaddefs cl-lib
cus-load info fb2-reader-autoloads async-autoloads f-autoloads
ein-autoloads bbdb-autoloads yaml-mode-autoloads with-editor-autoloads
dash-autoloads request-autoloads yasnippet-snippets-autoloads
compat-autoloads websearch-autoloads elpy-autoloads s-autoloads
company-autoloads polymode-autoloads edit-server-autoloads
markdown-mode-autoloads rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process emacs)

Memory information:
((conses 16 691472 82991)
 (symbols 48 40963 6)
 (strings 32 262476 9487)
 (string-bytes 1 7246730)
 (vectors 16 110814)
 (vector-slots 8 2207864 131822)
 (floats 8 1153 347)
 (intervals 56 17739 877)
 (buffers 976 105))

-- 
Sam Steingold (https://aphar.dreamwidth.org/) on darwin Ns 10.3.2113
https://lastingimpactpsychology.com https://steingoldpsychology.com
https://iris.org.il https://fairforall.org http://think-israel.org
A bullet affects the way the brain functions even when it hits the butt.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-12 16:31 bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp Sam Steingold
@ 2022-12-12 18:29 ` Juri Linkov
  2022-12-13 17:16   ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2022-12-12 18:29 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 60011

> I run Emacs locally (macosx laptop) and edit remote (Amazon Linux "cloud
> desktop") files using tramp (scp).
> I can commit files using vc/git just fine.
> However, when I edit *vc-diff* and hit C-v v v (vc-next-action), and
> then edit the commit message abd hit C-c C-c, I get this error:
>
> Debugger entered--Lisp error: (error "Failed (status 128): git --no-pager apply --cached...")
>   signal(error ("Failed (status 128): git --no-pager apply --cached..."))
>   error("Failed (%s): %s" "status 128" "git --no-pager apply --cached /var/folders/20/__3t...")
>   vc-do-command("*vc*" 0 "git" "/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/g..." "--no-pager" "apply" "--cached")
>   apply(vc-do-command "*vc*" 0 "git" "/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/g..." ("--no-pager" "apply" "--cached"))
>   vc-git-command(nil 0 "/var/folders/20/__3tt7vx6wg51x8xvqdc1cmw0000gr/T/g..." "apply" "--cached")
>   vc-git-checkin(nil #("Summary: TEE: split pairs_mx into make_da2mt_mx an..." ...

The problem is in these lines that create a temporary file
on a local directory only:

      (let ((patch-file (make-temp-file "git-patch")))
        (with-temp-file patch-file
          (insert vc-git-patch-string))
        (unwind-protect
            (vc-git-command nil 0 patch-file "apply" "--cached")
          (delete-file patch-file)))

I'm not yet sure whether using make-nearby-temp-file could help
to create a temporary file on a remote directory, need to try.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-12 18:29 ` Juri Linkov
@ 2022-12-13 17:16   ` Juri Linkov
  2022-12-13 18:33     ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2022-12-13 17:16 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Sam Steingold, 60011

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

Hi Michael,

Could you please confirm that I correctly implemented support for
Tramp in the following patch.

>> I run Emacs locally (macosx laptop) and edit remote (Amazon Linux "cloud
>> desktop") files using tramp (scp).
>> I can commit files using vc/git just fine.
>> However, when I edit *vc-diff* and hit C-v v v (vc-next-action), and
>> then edit the commit message abd hit C-c C-c, I get this error:
>> Debugger entered--Lisp error: (error "Failed (status 128): git --no-pager apply --cached...")
>
> The problem is in these lines that create a temporary file
> on a local directory only:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tramp-vc-git-checkin.patch --]
[-- Type: text/x-diff, Size: 1026 bytes --]

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 83138a6d107..65604e84d0e 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -103,6 +103,7 @@
 (require 'vc-dispatcher)
 (eval-when-compile
   (require 'subr-x) ; for string-trim-right
+  (require 'tramp)
   (require 'vc)
   (require 'vc-dir))
 
@@ -1048,7 +1049,13 @@ vc-git-checkin
                         (string-replace file-diff "" vc-git-patch-string))
                 (user-error "Index not empty"))
               (setq pos (point))))))
-      (let ((patch-file (make-temp-file "git-patch")))
+      (let ((patch-file
+             (if (file-remote-p default-directory)
+                 (with-parsed-tramp-file-name
+                     (expand-file-name default-directory) nil
+                   (tramp-make-tramp-file-name
+                    v (with-no-warnings (tramp-make-tramp-temp-file v))))
+               (make-temp-file "git-patch"))))
         (with-temp-file patch-file
           (insert vc-git-patch-string))
         (unwind-protect

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-13 17:16   ` Juri Linkov
@ 2022-12-13 18:33     ` Michael Albinus
  2022-12-14  8:06       ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2022-12-13 18:33 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Sam Steingold, 60011

Juri Linkov <juri@linkov.net> writes:

> Hi Michael,

Hi Juri,

> Could you please confirm that I correctly implemented support for
> Tramp in the following patch.

No.

> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index 83138a6d107..65604e84d0e 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -103,6 +103,7 @@
>  (require 'vc-dispatcher)
>  (eval-when-compile
>    (require 'subr-x) ; for string-trim-right
> +  (require 'tramp)
>    (require 'vc)
>    (require 'vc-dir))
>
> @@ -1048,7 +1049,13 @@ vc-git-checkin
>                          (string-replace file-diff "" vc-git-patch-string))
>                  (user-error "Index not empty"))
>                (setq pos (point))))))
> -      (let ((patch-file (make-temp-file "git-patch")))
> +      (let ((patch-file
> +             (if (file-remote-p default-directory)
> +                 (with-parsed-tramp-file-name
> +                     (expand-file-name default-directory) nil
> +                   (tramp-make-tramp-file-name
> +                    v (with-no-warnings (tramp-make-tramp-temp-file v))))
> +               (make-temp-file "git-patch"))))
>          (with-temp-file patch-file
>            (insert vc-git-patch-string))
>          (unwind-protect

Please don't use Tramp internal functions. As somebody else said in
this thread, make-nearby-temp-file should be good enough.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-13 18:33     ` Michael Albinus
@ 2022-12-14  8:06       ` Juri Linkov
  2022-12-14 21:58         ` Sam Steingold
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2022-12-14  8:06 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Sam Steingold, 60011

close 60011 29.0.60
thanks

> Please don't use Tramp internal functions. As somebody else said in
> this thread, make-nearby-temp-file should be good enough.

Thanks for confirming.  I was not sure that the fix is so much simple.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-14  8:06       ` Juri Linkov
@ 2022-12-14 21:58         ` Sam Steingold
  2022-12-15  7:27           ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Steingold @ 2022-12-14 21:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Michael Albinus, 60011

Juri, thank you very much for fixing the bug.
Alas, I don't see your fix in the master - do you mind merging it there also?
Thank you again!

On Wed, 14 Dec 2022 at 03:06, Juri Linkov <juri@linkov.net> wrote:
>
> close 60011 29.0.60
> thanks
>
> > Please don't use Tramp internal functions. As somebody else said in
> > this thread, make-nearby-temp-file should be good enough.
>
> Thanks for confirming.  I was not sure that the fix is so much simple.



-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net>
<http://steingoldpsychology.com>





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-14 21:58         ` Sam Steingold
@ 2022-12-15  7:27           ` Juri Linkov
  2022-12-16  7:52             ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2022-12-15  7:27 UTC (permalink / raw)
  To: Sam Steingold; +Cc: Michael Albinus, 60011

> Juri, thank you very much for fixing the bug.
> Alas, I don't see your fix in the master - do you mind merging it there also?

Sorry, we need to wait until someone will merge the changes from the
emacs-29 branch to master.  I'm not confident doing this myself since
the merging script often breaks the NEWS file and omits some commits.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp
  2022-12-15  7:27           ` Juri Linkov
@ 2022-12-16  7:52             ` Juri Linkov
  0 siblings, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2022-12-16  7:52 UTC (permalink / raw)
  To: Sam Steingold; +Cc: Michael Albinus, 60011

>> Juri, thank you very much for fixing the bug.
>> Alas, I don't see your fix in the master - do you mind merging it there also?
>
> Sorry, we need to wait until someone will merge the changes from the
> emacs-29 branch to master.  I'm not confident doing this myself since
> the merging script often breaks the NEWS file and omits some commits.

Now the fix arrived to master, please try again.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-16  7:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 16:31 bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp Sam Steingold
2022-12-12 18:29 ` Juri Linkov
2022-12-13 17:16   ` Juri Linkov
2022-12-13 18:33     ` Michael Albinus
2022-12-14  8:06       ` Juri Linkov
2022-12-14 21:58         ` Sam Steingold
2022-12-15  7:27           ` Juri Linkov
2022-12-16  7:52             ` Juri Linkov

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.