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

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

bug#70526: closed (29.2; package-vc-upgrade failed with error message "F


From: GNU bug Tracking System
Subject: bug#70526: closed (29.2; package-vc-upgrade failed with error message "File is not under version control")
Date: Sat, 27 Apr 2024 07:29:05 +0000

Your message dated Sat, 27 Apr 2024 07:28:19 +0000
with message-id <87frv7s1rg.fsf@posteo.net>
and subject line Re: bug#70526: 29.2; package-vc-upgrade failed with error 
message "File is not under version control"
has caused the debbugs.gnu.org bug report #70526,
regarding 29.2; package-vc-upgrade failed with error message "File is not under 
version control"
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
70526: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70526
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 29.2; package-vc-upgrade failed with error message "File is not under version control" Date: Tue, 23 Apr 2024 10:51:18 +0900
Hi all:

I encountered the following Backtrace information when invoking
`package-vc-upgrade'.

Debugger entered--Lisp error: (error "File is not under version control")
  error("File is not under version control")
  vc-deduce-fileset-1(t nil nil)
  vc-deduce-fileset(t)
  vc-pull()
  ......

After some edebug debugging and reading the source code, I found that
this error occurs if the buffer where `package-vc-upgrade' is called is
not under a git repository. Additionally, if the current buffer of the
command invocation does not correspond to a specific file, then the
command can execute normally.

After reading the implementation of `package-vc-upgrade', I found that it
binds `default-directory' to the package's path. However, the internally
called `vc-pull' function, which uses `vc-deduce-fileset-1', first
utilizes `buffer-file-name' instead of `default-directory' to fetch
version control backend related information, which leads to this error.

In my past usage, I did not encounter this error, probably because I
usually invoked it within a file buffer under a git repository, or used
the command in a buffer provided by `list-packages'. Here is one
solution I used:

(when (eq emacs-major-version 29)
  (defun yy/package-vc-upgrade-advice (upfun pkg-desc)
    (with-temp-buffer
      (funcall upfun pkg-desc)))
  (advice-add 'package-vc-upgrade :around 'yy/package-vc-upgrade-advice))

In a minimal environment with emacs -Q, the following steps can
reproduce my issue:

;; a simple package by purcell
(package-vc-install "https://github.com/purcell/unfill")
;; then try to upgrade it in a buffer that buffer-file-name is not nil
;; and the file is not under Git version control system.
M-x package-vc-upgrade unfill RET
;; now the error may occurs

Regards

YI YUE


--- End Message ---
--- Begin Message --- Subject: Re: bug#70526: 29.2; package-vc-upgrade failed with error message "File is not under version control" Date: Sat, 27 Apr 2024 07:28:19 +0000
"o0o0o耗子" <include_yy@qq.com> writes:

> &gt; As the buffer is hidden, I didn't see the need to clean it up.
> It can &gt; be re-used later on and might help with debugging. I think
> you are right. Now we fix this bug. Regards

I have pushed the changes, and will therefore close this bug report.
Thank you for your help!

-- 
        Philip Kaludercic on peregrine


--- End Message ---

reply via email to

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