GNU bug report logs - #26345
25.1; vc-annotate in Git is unable to fully navigate the history if the file was moved

Previous Next

Package: emacs;

Reported by: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>

Date: Mon, 3 Apr 2017 00:06:02 UTC

Severity: normal

Found in version 25.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

To reply to this bug, email your comments to 26345 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 03 Apr 2017 00:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wojciech Siewierski <wojciech.siewierski <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 03 Apr 2017 00:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; vc-annotate in Git is unable to fully navigate the history if
 the file was moved
Date: Sun, 2 Apr 2017 23:46:12 +0200
[Message part 1 (text/plain, inline)]
It seems some vc-git operations override `default-directory' with the
parent directory of the files they operate on. It's a problem if they no
longer exist like in the following scenario.

Preparation steps in shell:

$ git init
$ mkdir olddir/
$ echo oldcontent > olddir/file.txt
$ git add olddir/
$ git commit -m 'Initial commit'
$ echo newcontent > olddir/file.txt
$ git add olddir/
$ git commit -m 'Modify the file'
$ git mv olddir/ newdir/
$ git commit -m 'Move the file'

Reproduction:

1. Open newdir/file.txt in Emacs.
2. Press `C-x v g' to open `vc-annotate'.
3. Press `j' to jump to the revision from before the file was moved.
4. Try to move to the next (newer) revision with `n'. The error appears
here.

> apply: Setting current directory: No such file or directory,
.../testrepo/olddir/

It seems in this scenario `vc-annotate' also has trouble with the
regular navigation (`n' and `p') without the usage of `j' but the error
message is not as clear.



In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.31)
 of 2017-01-08 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:    Ubuntu 16.04.2 LTS

Configured using:
 'configure --disable-dependency-tracking
 --prefix=/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1
 --with-modules --with-x-toolkit=gtk2 --with-xft'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  TeX-PDF-mode: t
  magit-auto-revert-mode: t
  ido-vertical-mode: t
  flx-ido-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  projectile-mode: t
  global-diff-hl-mode: t
  hl-line-mode: t
  global-company-mode: t
  company-mode: t
  org-bullets-mode: t
  recentf-mode: t
  bbyac-global-mode: t
  bbyac-mode: t
  beacon-mode: t
  volatile-highlights-mode: t
  global-git-commit-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  show-paren-mode: t
  minibuffer-depth-indicate-mode: t
  electric-pair-mode: t
  global-subword-mode: t
  subword-mode: t
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  async-bytecomp-package-mode: t
  ivy-mode: t
  override-global-mode: t
  winner-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Type C-x 1 to delete the help window, C-M-v to scroll help.
Quit

When done with this frame, type C-x 5 0
Quit
When done with this frame, type C-x 5 0
Quit [3 times]
Type C-x 1 to delete the help window, C-M-v to scroll help.
Mark set
C-x C-g is undefined
Quit

Load-path shadows:
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/scala-mode-20170323.502/ob-scala
hides
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-scala
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-texinfo
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-texinfo
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-publish
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-publish
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-org
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-org
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-odt
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-odt
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-md
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-md
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-man
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-man
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-latex
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-latex
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-icalendar
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-icalendar
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-html
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-html
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-beamer
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-beamer
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ox-ascii
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ox-ascii
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-w3m
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-w3m
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-version
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-version
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-timer
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-timer
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-table
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-table
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-src
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-src
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-rmail
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-rmail
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-protocol
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-protocol
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-plot
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-plot
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-pcomplete
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-pcomplete
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-mouse
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-mouse
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-mobile
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-mobile
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-mhe
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-mhe
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-macs
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-macs
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-macro
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-macro
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-loaddefs
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-loaddefs
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-list
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-list
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-irc
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-irc
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-install
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-install
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-inlinetask
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-inlinetask
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-info
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-info
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-indent
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-indent
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-id
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-id
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-habit
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-habit
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-gnus
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-gnus
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-footnote
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-footnote
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-feed
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-feed
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-faces
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-faces
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-eshell
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-eshell
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-entities
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-entities
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-element
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-element
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-docview
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-docview
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-datetree
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-datetree
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-ctags
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-ctags
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-crypt
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-crypt
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-compat
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-compat
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-colview
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-colview
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-clock
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-clock
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-capture
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-capture
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-bibtex
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-bibtex
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-bbdb
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-bbdb
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-attach
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-attach
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-archive
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-archive
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/org-agenda
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/org-agenda
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-tangle
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-tangle
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-table
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-table
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-sqlite
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-sqlite
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-sql
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-sql
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-shen
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-shen
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-screen
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-screen
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-scheme
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-scheme
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/scala-mode-20170323.502/ob-scala
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-scala
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-sass
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-sass
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-ruby
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-ruby
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-ref
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-ref
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-python
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-python
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-plantuml
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-plantuml
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-picolisp
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-picolisp
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-perl
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-perl
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-org
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-org
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-octave
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-octave
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-ocaml
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-ocaml
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-mscgen
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-mscgen
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-maxima
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-maxima
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-matlab
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-matlab
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-makefile
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-makefile
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-lob
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-lob
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-lisp
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-lisp
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-lilypond
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-lilypond
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-ledger
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-ledger
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-latex
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-latex
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-keys
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-keys
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-js
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-js
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-java
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-java
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-io
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-io
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-haskell
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-haskell
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-gnuplot
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-gnuplot
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-fortran
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-fortran
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-exp
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-exp
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-eval
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-eval
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-emacs-lisp
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-emacs-lisp
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-dot
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-dot
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-ditaa
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-ditaa
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-css
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-css
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-core
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-core
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-comint
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-comint
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-clojure
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-clojure
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-calc
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-calc
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-awk
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-awk
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-asymptote
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-asymptote
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-R
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-R
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/org-20170210/ob-C
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/org/ob-C
/home/vifon/projects/configs/emacs-config/emacs.d/.cask/25.1/elpa/seq-2.19/seq
hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/emacs-lisp/seq
~/.emacs.d/skeletons/generic hides
/nix/store/89cab82wdiyii22cxmf50f88vc1wj3y0-emacs-25.1/share/emacs/25.1/lisp/emacs-lisp/generic

Features:
(shadow mail-extr emacsbug sendmail pulse debug eieio-opt speedbar
sb-image ezimage dframe vc-annotate helm-projectile helm-files
image-dired helm-tags helm-bookmark helm-adaptive helm-info
helm-external helm-net helm-buffers helm-grep helm-regexp helm-elscreen
helm-utils helm-locate helm-types c-c++-header breadcrumb find-file
expand-region cperl-mode-expansions text-mode-expansions
cc-mode-expansions the-org-mode-expansions python-el-fgallina-expansions
latex-mode-expansions er-basic-expansions expand-region-core
expand-region-custom cl-indent wdired slime hyperspec browse-url sort
iedit iedit-lib dired-aux rst vim-line-open tramp-cache ispell tabify
cal-move parse-time epa-file epa org-datetree org-capture haskell-doc
inf-haskell haskell-decl-scan geiser-mode geiser-xref geiser-compile
geiser-debug geiser-chibi geiser-mit geiser-chez geiser-chicken
geiser-racket geiser-guile info-look geiser geiser-repl geiser-image
geiser-company geiser-doc geiser-menu geiser-edit geiser-completion
geiser-autodoc geiser-eval geiser-connection tq geiser-syntax geiser-log
geiser-popup view geiser-impl geiser-custom geiser-base scheme
dired-subtree dired-hacks-utils network-stream nsm starttls warnings
git-rebase texmathp preview prv-emacs tex-buf indent-guide font-latex
latex tex-ispell tex-style tex dbus tex-mode latexenc wgrep-ag wgrep ag
vc-svn find-dired magit-obsolete magit-blame magit-stash magit-bisect
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-branch magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log magit-diff smerge-mode magit-core
magit-autorevert autorevert filenotify magit-process magit-margin
magit-mode magit-git crm magit-section magit-popup misearch
multi-isearch smex ido-vertical-mode flx-ido ido vc-git org-table
org-agenda company-rtags colir color counsel esh-util swiper org-clock
ansible yasnippet rtags repeat bookmark projectile diff-hl vc-dir vc
vc-dispatcher hl-line haskell haskell-completions haskell-load
haskell-commands highlight-uses-mode haskell-modules haskell-sandbox
haskell-repl haskell-debug haskell-interactive-mode
haskell-presentation-mode haskell-collapse haskell-navigate-imports
haskell-compile haskell-process haskell-session haskell-hoogle
haskell-mode haskell-cabal haskell-utils haskell-font-lock
haskell-indentation haskell-string haskell-sort-imports haskell-lexeme
haskell-align-imports haskell-compat haskell-complete-module
haskell-ghc-support dabbrev haskell-customize macrostep-c cmacexp
macrostep sh-script smie executable company-files company-oddmuse
company-clang company-dabbrev-code company-dabbrev company-keywords
company-etags company-gtags company-capf company-cmake company-xcode
company-semantic company-eclim company-template company-css company-nxml
company-bbdb company-tern dash-functional tern url-http tls gnutls
url-auth company flycheck jedi auto-complete jedi-core
python-environment epc ctable concurrent deferred python perltidy
cperl-lineup cperl-mode paredit yafolding org-bullets disp-table
org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view subr-x
jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m my-secret
zenburn-theme recentf-merge recentf tree-widget wid-edit avy bbyac
browse-kill-ring derived ecomplete racer rust-mode ggtags phi-search
phi-search-core multiple-cursors mc-hide-unmatched-lines-mode
mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more
mc-cycle-cursors mc-edit-lines multiple-cursors-core rect beacon etags
xref project volatile-highlights highlight-symbol goto-last-change p4
ps-print ps-def lpr stgit ewoc git-commit with-editor tramp-sh server
magit-utils log-edit message rfc822 mml mml-sec epg mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log legalese finder
diary-lib diary-loaddefs undo-tree diff dired-x pastes-from-web
my-scratch my-global-settings cualess-global-mark avoid paren mb-depth
elec-pair cap-words superword subword my-registers my-fixes
disable-suspend fuck-you-slime lineup my-eshell my-org steam xml url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap org-crypt ob-scala ensime ensime-mode
ensime-sbt sbt-mode sbt-mode-rgrep grep sbt-mode-comint sbt-mode-buffer
sbt-mode-project sbt-mode-vars ensime-http ensime-ui
ensime-semantic-highlight ensime-doc ensime-search ensime-undo
ensime-startup ensime-refactor diff-mode ensime-popup ensime-notes
ensime-model ensime-inspector imenu ensime-goto-testfile ensime-editor
popup ensime-debug gdb-mi bindat gud ensime-stacktrace ensime-inf
ensime-overlay ensime-completion-util ensime-config ensime-util
ensime-client ensime-vars url-gw scala-mode scala-mode-prettify-symbols
scala-mode-imenu scala-mode-map scala-mode-fontlock scala-mode-indent
scala-mode-paragraph scala-mode-syntax scala-mode-lib pp hideshow
flymake arc-mode archive-mode ensime-macros cl ob-java ob-perl ob-python
ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs ob-haskell ob-sqlite ob-octave ob-gnuplot
ob-dot ob-plantuml ob-ditaa ob-makefile ob-sed ob-awk ob-shell
org-protocol org-element avl-tree org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table
ob-keys ob-exp ob-comint tramp tramp-compat tramp-loaddefs trampver
shell pcomplete ob-core ob-eval org-compat org-macs org-loaddefs
format-spec find-func cal-menu calendar cal-loaddefs my-ibuffer
ibuffer-vc ibuf-ext ibuffer my-helm helm-help helm helm-source
eieio-compat helm-multi-match helm-lib dired helm-config helm-easymenu
async-bytecomp async my-ivy ivy-hydra ivy flx delsel ivy-overlay ffap
thingatpt url-parse auth-source eieio gnus-util time-date password-cache
url-vars my-god-mode god-mode my-keys windmove my-fun my-mode-line
my-skeletons skeletor compile comint ansi-color rx let-alist autoinsert
skeleton my-hooks hydra lv key-chord use-package diminish bind-key
easy-mmode tex-site eieio-core advice slime-autoloads info edmacro
kmacro cask cl-seq cl-macs cask-bootstrap package-build mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr json map lisp-mnt shut-up epl git commander
f dash s ucs-normalize finder-inf package epg-config seq byte-opt gv
bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs
pcase cl-lib my-compat winner ring cus-start cus-load mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 1451135 142112)
 (symbols 48 82760 0)
 (miscs 40 9828 3493)
 (strings 32 438521 140156)
 (string-bytes 1 8714254)
 (vectors 16 159814)
 (vector-slots 8 3567015 52260)
 (floats 8 3169 4363)
 (intervals 56 44066 417)
 (buffers 976 192))


[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 10 Apr 2017 02:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>, 26345 <at> debbugs.gnu.org
Subject: Re: bug#26345: 25.1; vc-annotate in Git is unable to fully navigate
 the history if the file was moved
Date: Mon, 10 Apr 2017 05:30:14 +0300
On 03.04.2017 00:46, Wojciech Siewierski wrote:
> 
> It seems some vc-git operations override `default-directory' with the
> parent directory of the files they operate on. It's a problem if they no
> longer exist like in the following scenario.
> 
> Preparation steps in shell:
> 
> $ git init
> $ mkdir olddir/
> $ echo oldcontent > olddir/file.txt
> $ git add olddir/
> $ git commit -m 'Initial commit'
> $ echo newcontent > olddir/file.txt
> $ git add olddir/
> $ git commit -m 'Modify the file'
> $ git mv olddir/ newdir/
> $ git commit -m 'Move the file'
> 
> Reproduction:
> 
> 1. Open newdir/file.txt in Emacs.
> 2. Press `C-x v g' to open `vc-annotate'.
> 3. Press `j' to jump to the revision from before the file was moved.
> 4. Try to move to the next (newer) revision with `n'. The error appears
> here.

Thanks. For the report. I'm including a minor patch below. Does it 
improve things considerably for you?

>> apply: Setting current directory: No such file or directory,
> .../testrepo/olddir/
> 
> It seems in this scenario `vc-annotate' also has trouble with the
> regular navigation (`n' and `p') without the usage of `j' but the error
> message is not as clear.

The problem of `n' and `p' navigation between revisions where the file 
name changed is still present, because of how `vc-git-next-revision' is 
written. Suggestions for a better implementation are welcome.

The patch that fixes the first scenario:

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 1a3f1bf..4767cbf 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1274,9 +1274,8 @@ vc-git--rev-parse

 (defun vc-git-next-revision (file rev)
   "Git-specific version of `vc-next-revision'."
-  (let* ((default-directory (file-name-directory
-			     (expand-file-name file)))
-         (file (file-name-nondirectory file))
+  (let* ((default-directory (vc-git-root file))
+         (file (file-relative-name file))
          (current-rev
           (with-temp-buffer
             (and




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 10 Apr 2017 15:07:01 GMT) Full text and rfc822 format available.

Message #11 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, 26345 <at> debbugs.gnu.org
Subject: Re: bug#26345: 25.1; vc-annotate in Git is unable to fully navigate
 the history if the file was moved
Date: Mon, 10 Apr 2017 17:06:16 +0200
[Message part 1 (text/plain, inline)]
On 10.04.2017 04:30, Dmitry Gutov wrote:
> On 03.04.2017 00:46, Wojciech Siewierski wrote:
>>
>> It seems some vc-git operations override `default-directory' with the
>> parent directory of the files they operate on. It's a problem if they no
>> longer exist like in the following scenario.
>>
>> Preparation steps in shell:
>>
>> $ git init
>> $ mkdir olddir/
>> $ echo oldcontent > olddir/file.txt
>> $ git add olddir/
>> $ git commit -m 'Initial commit'
>> $ echo newcontent > olddir/file.txt
>> $ git add olddir/
>> $ git commit -m 'Modify the file'
>> $ git mv olddir/ newdir/
>> $ git commit -m 'Move the file'
>>
>> Reproduction:
>>
>> 1. Open newdir/file.txt in Emacs.
>> 2. Press `C-x v g' to open `vc-annotate'.
>> 3. Press `j' to jump to the revision from before the file was moved.
>> 4. Try to move to the next (newer) revision with `n'. The error appears
>> here.
>
> Thanks. For the report. I'm including a minor patch below. Does it
> improve things considerably for you?
>
>>> apply: Setting current directory: No such file or directory,
>> .../testrepo/olddir/
>>
>> It seems in this scenario `vc-annotate' also has trouble with the
>> regular navigation (`n' and `p') without the usage of `j' but the error
>> message is not as clear.
>
> The problem of `n' and `p' navigation between revisions where the file
> name changed is still present, because of how `vc-git-next-revision'
> is written. Suggestions for a better implementation are welcome.
>
> The patch that fixes the first scenario:
>
> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index 1a3f1bf..4767cbf 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -1274,9 +1274,8 @@ vc-git--rev-parse
>
>  (defun vc-git-next-revision (file rev)
>    "Git-specific version of `vc-next-revision'."
> -  (let* ((default-directory (file-name-directory
> -                 (expand-file-name file)))
> -         (file (file-name-nondirectory file))
> +  (let* ((default-directory (vc-git-root file))
> +         (file (file-relative-name file))
>           (current-rev
>            (with-temp-buffer
>              (and
The error is gone but usability-wise not much has changed: now the
vc-annotate buffer contains "fatal: no such path olddir/file.txt in
master" after I finish my test scenario. I guess not much more can be
done. Thanks!

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 10 Apr 2017 23:27:02 GMT) Full text and rfc822 format available.

Message #14 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>, 26345 <at> debbugs.gnu.org
Subject: Re: bug#26345: 25.1; vc-annotate in Git is unable to fully navigate
 the history if the file was moved
Date: Tue, 11 Apr 2017 02:25:55 +0300
On 10.04.2017 18:06, Wojciech Siewierski wrote:

> The error is gone but usability-wise not much has changed: now the
> vc-annotate buffer contains "fatal: no such path olddir/file.txt in
> master" after I finish my test scenario.

Hmm, you're right. It does, however, improve the following scenario:

C-x v g, j, p, n

I.e. you can move between revisions belonging to the old file name (with 
the next/previous commands), just not between different file names.

> I guess not much more can be done.

It probably can, but someone would have to work out the exact sequence 
of Git commands to do what we want.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Fri, 14 Apr 2017 23:47:02 GMT) Full text and rfc822 format available.

Message #17 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, 26345 <at> debbugs.gnu.org
Subject: Re: bug#26345: 25.1; vc-annotate in Git is unable to fully navigate
 the history if the file was moved
Date: Sat, 15 Apr 2017 01:46:32 +0200
[Message part 1 (text/plain, inline)]
On 11.04.2017 01:25, Dmitry Gutov wrote:
> On 10.04.2017 18:06, Wojciech Siewierski wrote:
>
>> The error is gone but usability-wise not much has changed: now the
>> vc-annotate buffer contains "fatal: no such path olddir/file.txt in
>> master" after I finish my test scenario.
>
> Hmm, you're right. It does, however, improve the following scenario:
>
> C-x v g, j, p, n
>
> I.e. you can move between revisions belonging to the old file name
> (with the next/previous commands), just not between different file names.
>
>> I guess not much more can be done.
>
> It probably can, but someone would have to work out the exact sequence
> of Git commands to do what we want.
Right, I missed that but you're right. That's definitely a massive
improvement. Thanks!

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 01 May 2017 01:42:02 GMT) Full text and rfc822 format available.

Message #20 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Wojciech Siewierski <wojciech.siewierski <at> gmail.com>, 26345 <at> debbugs.gnu.org
Subject: Re: bug#26345: 25.1; vc-annotate in Git is unable to fully navigate
 the history if the file was moved
Date: Mon, 1 May 2017 04:41:04 +0300
On 15.04.2017 2:46, Wojciech Siewierski wrote:

>> Hmm, you're right. It does, however, improve the following scenario:
>>
>> C-x v g, j, p, n
>>
>> I.e. you can move between revisions belonging to the old file name
>> (with the next/previous commands), just not between different file names.

> Right, I missed that but you're right. That's definitely a massive
> improvement. Thanks!

I've pushed that patch now. Keeping this bug open because it doesn't fix 
the main scenario.

For future reference (mine or someone else's): when we reach the end of 
the revision list for a particular file name, we can call 'git show REV 
-M' to look for the next file name, a simple example here: 
https://kparal.wordpress.com/2011/08/03/git-tip-of-the-day-detect-moved-files/.




Severity set to 'minor' from 'normal' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 06 May 2017 17:01:02 GMT) Full text and rfc822 format available.

Severity set to 'normal' from 'minor' Request was from Sean Whitton <spwhitton <at> spwhitton.name> to control <at> debbugs.gnu.org. (Fri, 14 Mar 2025 05:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 30 Jun 2025 20:33:02 GMT) Full text and rfc822 format available.

Message #27 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: dgutov <at> yandex.ru
Cc: Jakub Ječmínek <kuba <at> kubajecminek.cz>,
 26345 <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
Subject: [PATCH] Handle renamed files when cycling through revisions
Date: Mon, 30 Jun 2025 22:29:43 +0200
* lisp/vc/vc-git.el (vc-git-registered,vc-git-annotate-command):
Update the FILE argument passed to 'vc-git-annotate-command'
based on whether FILE exists in the current revision. If it
doesn't, look up its new name. (Bug#26345)
---
What do you think about the patch below?

 lisp/vc/vc-git.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index e27798913fe..8f10893d0ba 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -289,12 +289,13 @@ vc-git-update-on-retrieve-tag
 ;;;###autoload         (load "vc-git" nil t)
 ;;;###autoload         (vc-git-registered file))))
 
-(defun vc-git-registered (file)
+(defun vc-git-registered (file &optional rev)
   "Check whether FILE is registered with git."
   (let ((dir (vc-git-root file)))
     (when dir
       (with-temp-buffer
         (let* (process-file-side-effects
+               (rev (or rev "HEAD"))
                ;; Do not use the `file-name-directory' here: git-ls-files
                ;; sometimes fails to return the correct status for relative
                ;; path specs.
@@ -306,7 +307,7 @@ vc-git-registered
                       ;; If result is empty, use ls-tree to check for deleted
                       ;; file.
                       (when (eq (point-min) (point-max))
-                        (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEAD"
+                        (vc-git--out-ok "ls-tree" "--name-only" "-z" rev
                                         "--" name))
                       (buffer-string))))
           (and str
@@ -1860,7 +1861,12 @@ vc-git-revision-completion-table
 
 (defun vc-git-annotate-command (file buf &optional rev)
   (vc-git--asciify-coding-system)
-  (let ((name (file-relative-name file)))
+  ;; If the file does not exist in the tree, it most likely means
+  ;; that it has been renamed.  Bug#26345
+  (let* ((file (if (vc-git-registered file rev)
+                   file
+                 (cdr (assoc file (vc-git-file-name-changes rev)))))
+         (name (file-relative-name file)))
     (apply #'vc-git-command buf 'async nil "blame" "--date=short"
 	   (append (vc-switches 'git 'annotate)
 		   (list rev "--" name)))))
-- 
2.49.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sat, 05 Jul 2025 08:58:02 GMT) Full text and rfc822 format available.

Message #30 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Cc: kuba <at> kubajecminek.cz, wojciech.siewierski <at> gmail.com, 26345 <at> debbugs.gnu.org,
 dgutov <at> yandex.ru
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sat, 05 Jul 2025 11:57:33 +0300
> Cc: Jakub Ječmínek <kuba <at> kubajecminek.cz>,
>  26345 <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
> Date: Mon, 30 Jun 2025 22:29:43 +0200
> From:  Jakub Ječmínek via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> * lisp/vc/vc-git.el (vc-git-registered,vc-git-annotate-command):
> Update the FILE argument passed to 'vc-git-annotate-command'
> based on whether FILE exists in the current revision. If it
> doesn't, look up its new name. (Bug#26345)
> ---
> What do you think about the patch below?

Sean, any comments?

>  lisp/vc/vc-git.el | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index e27798913fe..8f10893d0ba 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -289,12 +289,13 @@ vc-git-update-on-retrieve-tag
>  ;;;###autoload         (load "vc-git" nil t)
>  ;;;###autoload         (vc-git-registered file))))
>  
> -(defun vc-git-registered (file)
> +(defun vc-git-registered (file &optional rev)
>    "Check whether FILE is registered with git."
>    (let ((dir (vc-git-root file)))
>      (when dir
>        (with-temp-buffer
>          (let* (process-file-side-effects
> +               (rev (or rev "HEAD"))
>                 ;; Do not use the `file-name-directory' here: git-ls-files
>                 ;; sometimes fails to return the correct status for relative
>                 ;; path specs.
> @@ -306,7 +307,7 @@ vc-git-registered
>                        ;; If result is empty, use ls-tree to check for deleted
>                        ;; file.
>                        (when (eq (point-min) (point-max))
> -                        (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEAD"
> +                        (vc-git--out-ok "ls-tree" "--name-only" "-z" rev
>                                          "--" name))
>                        (buffer-string))))
>            (and str
> @@ -1860,7 +1861,12 @@ vc-git-revision-completion-table
>  
>  (defun vc-git-annotate-command (file buf &optional rev)
>    (vc-git--asciify-coding-system)
> -  (let ((name (file-relative-name file)))
> +  ;; If the file does not exist in the tree, it most likely means
> +  ;; that it has been renamed.  Bug#26345
> +  (let* ((file (if (vc-git-registered file rev)
> +                   file
> +                 (cdr (assoc file (vc-git-file-name-changes rev)))))
> +         (name (file-relative-name file)))
>      (apply #'vc-git-command buf 'async nil "blame" "--date=short"
>  	   (append (vc-switches 'git 'annotate)
>  		   (list rev "--" name)))))
> -- 
> 2.49.0
> 
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sat, 05 Jul 2025 16:43:02 GMT) Full text and rfc822 format available.

Message #33 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: dgutov <at> yandex.ru, 26345 <at> debbugs.gnu.org,
 Elizabeth Ferdman <gnudevliz <at> gmail.com>, wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sat, 05 Jul 2025 17:42:04 +0100
Hello,

On Mon 30 Jun 2025 at 10:29pm +02, Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> * lisp/vc/vc-git.el (vc-git-registered,vc-git-annotate-command):
> Update the FILE argument passed to 'vc-git-annotate-command'
> based on whether FILE exists in the current revision. If it
> doesn't, look up its new name. (Bug#26345)
> ---
> What do you think about the patch below?

Thanks for posting this.

We can't add an optional argument to vc-git-registered directly because
that's the vc-git implementation for the `registered' backend function,
so its lambda list is fixed by the API.  You could get around this by
making vc-git-registered a tiny wrapper around a function
vc-git--registered which has all the existing code plus the optional
argument.

But is the call to vc-git-registered needed at all?  Why not just look
at the file name changes list immediately, and if the file does not
appear there, assume that the original file name is valid?

And maybe then this could happen up in vc-annotate instead of being
Git-specific.  It's kind of a heuristic anyway.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sun, 06 Jul 2025 02:13:03 GMT) Full text and rfc822 format available.

Message #36 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Sean Whitton <spwhitton <at> spwhitton.name>,
 Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: 26345 <at> debbugs.gnu.org, Elizabeth Ferdman <gnudevliz <at> gmail.com>,
 wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sun, 6 Jul 2025 05:11:44 +0300
On 05/07/2025 19:42, Sean Whitton wrote:
> But is the call to vc-git-registered needed at all?  Why not just look
> at the file name changes list immediately, and if the file does not
> appear there, assume that the original file name is valid?

I think (?) the file name might have changed in some later revision - so 
it won't be returned by vc-git-file-name-changes for that specific REV, 
but still might not match the current name.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sun, 06 Jul 2025 21:10:05 GMT) Full text and rfc822 format available.

Message #39 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Jakub =?utf-8?B?SmXEjW3DrW5law==?=
 <kuba <at> kubajecminek.cz>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 26345 <at> debbugs.gnu.org,
 wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sun, 06 Jul 2025 22:55:19 +0200



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sun, 06 Jul 2025 21:33:04 GMT) Full text and rfc822 format available.

Message #42 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Sean Whitton <spwhitton <at> spwhitton.name>
Cc: eliz <at> gnu.org, 26345 <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sun, 6 Jul 2025 23:30:11 +0200
I'm sending the e-mail again, I think my previous message was malformed.

Sean Whitton <spwhitton <at> spwhitton.name> writes:

> But is the call to vc-git-registered needed at all?  Why not just look
> at the file name changes list immediately, and if the file does not
> appear there, assume that the original file name is valid?

I think you're right, looking at `vc-*-file-name-changes' should be enough.

> And maybe then this could happen up in vc-annotate instead of being
> Git-specific.  It's kind of a heuristic anyway.

The problem occurs when we call `vc-annotate-next-revision', which in
turn calls `vc-annotate-warp-revision'. I can make the change there, but
I'm not familiar with any VCS other than Git, so I can't test it.

Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 05/07/2025 19:42, Sean Whitton wrote:
> I think (?) the file name might have changed in some later revision - so
> it won't be returned by vc-git-file-name-changes for that specific REV,
> but still might not match the current name.

I'm not sure.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 07 Jul 2025 08:35:05 GMT) Full text and rfc822 format available.

Message #45 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Jakub Ječmínek <kuba <at> kubajecminek.cz>, eliz <at> gnu.org,
 26345 <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Mon, 07 Jul 2025 09:34:30 +0100
Hello,

On Sun 06 Jul 2025 at 11:30pm +02, Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>> And maybe then this could happen up in vc-annotate instead of being
>> Git-specific.  It's kind of a heuristic anyway.
>
> The problem occurs when we call `vc-annotate-next-revision', which in
> turn calls `vc-annotate-warp-revision'. I can make the change there, but
> I'm not familiar with any VCS other than Git, so I can't test it.

That's okay, I think the only thing is to check that the backend
implements file-name-changes using vc-find-backend-function.  Then so
long as the general approach makes sense and works for Git it's fine.

> Dmitry Gutov <dgutov <at> yandex.ru> writes:
>
>> On 05/07/2025 19:42, Sean Whitton wrote:
>> I think (?) the file name might have changed in some later revision - so
>> it won't be returned by vc-git-file-name-changes for that specific REV,
>> but still might not match the current name.
>
> I'm not sure.

Seems like this needs to be investigated before we can proceed.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 07 Jul 2025 21:12:01 GMT) Full text and rfc822 format available.

Message #48 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Sean Whitton <spwhitton <at> spwhitton.name>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 26345 <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Mon, 7 Jul 2025 23:09:18 +0200
[Message part 1 (text/plain, inline)]
On 7/7/25 10:34, Sean Whitton wrote:
> That's okay, I think the only thing is to check that the backend
> implements file-name-changes using vc-find-backend-function.  Then so
> long as the general approach makes sense and works for Git it's fine.

I've updated the patch based on your suggestions. You're right, 
`vc-annotate' is indeed a better place for this change.

>> Dmitry Gutov <dgutov <at> yandex.ru> writes:
>>
>>> On 05/07/2025 19:42, Sean Whitton wrote:
>>> I think (?) the file name might have changed in some later revision - so
>>> it won't be returned by vc-git-file-name-changes for that specific REV,
>>> but still might not match the current name.
>>
>> I'm not sure.
> 
> Seems like this needs to be investigated before we can proceed.
I've tested various scenarios and haven't encountered any issues with 
the current implementation. It would be great if you could test the 
change as well, in case there are edge cases I missed.

[0001-Handle-renamed-files-when-cycling-through-revisions.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Tue, 08 Jul 2025 16:37:02 GMT) Full text and rfc822 format available.

Message #51 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Jakub Ječmínek
 <kuba <at> kubajecminek.cz>,
 26345 <at> debbugs.gnu.org,  wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Tue, 08 Jul 2025 11:30:40 +0100
[Message part 1 (text/plain, inline)]
Hello,

On Mon 07 Jul 2025 at 11:09pm +02, Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> On 7/7/25 10:34, Sean Whitton wrote:
>> That's okay, I think the only thing is to check that the backend
>> implements file-name-changes using vc-find-backend-function.  Then so
>> long as the general approach makes sense and works for Git it's fine.
>
> I've updated the patch based on your suggestions. You're right, `vc-annotate'
> is indeed a better place for this change.

Jakub, I'm attaching a version of your patch with a rewritten commit
message to more closely match our conventions, and to avoid overlong
lines of code.  Please take a look.

>>> Dmitry Gutov <dgutov <at> yandex.ru> writes:
>>>
>>>> On 05/07/2025 19:42, Sean Whitton wrote:
>>>> I think (?) the file name might have changed in some later revision - so
>>>> it won't be returned by vc-git-file-name-changes for that specific REV,
>>>> but still might not match the current name.
>>>
>>> I'm not sure.
>> Seems like this needs to be investigated before we can proceed.
> I've tested various scenarios and haven't encountered any issues with the
> current implementation. It would be great if you could test the change as
> well, in case there are edge cases I missed.

I think that we need to see an argument in terms of the definition of
the file-name-changes backend function that demonstrates that your
approach will always work:

;;   Return the list of pairs with changes in file names in REV.  When
;;   a file was added, it should be a cons with nil car.  When
;;   deleted, a cons with nil cdr.  When copied or renamed, a cons
;;   with the source name as car and destination name as cdr.

-- 
Sean Whitton
[0001-vc-annotate-Handle-renamed-files-when-changing-revis.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sat, 26 Jul 2025 20:17:01 GMT) Full text and rfc822 format available.

Message #54 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: wojciech.siewierski <at> gmail.com, 26345 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sat, 26 Jul 2025 22:14:37 +0200
Sean Whitton <spwhitton <at> spwhitton.name> writes:

>>> Seems like this needs to be investigated before we can proceed.
>> I've tested various scenarios and haven't encountered any issues with the
>> current implementation. It would be great if you could test the change as
>> well, in case there are edge cases I missed.
>
> I think that we need to see an argument in terms of the definition of
> the file-name-changes backend function that demonstrates that your
> approach will always work:
>
> ;;   Return the list of pairs with changes in file names in REV.  When
> ;;   a file was added, it should be a cons with nil car.  When
> ;;   deleted, a cons with nil cdr.  When copied or renamed, a cons
> ;;   with the source name as car and destination name as cdr.

My approach updates the FILE argument only if the file name has changed
in the given revision; otherwise, it keeps the name unchanged. I’m not
sure if it will **always** work, but it does fix the issue at hand. I'm
sorry, but I can't provide any further arguments in favor of this
change.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Tue, 29 Jul 2025 01:34:01 GMT) Full text and rfc822 format available.

Message #57 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 26345 <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Tue, 29 Jul 2025 04:32:50 +0300
[Message part 1 (text/plain, inline)]
Hi all!

On 26/07/2025 23:14, Jakub Ječmínek via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Sean Whitton<spwhitton <at> spwhitton.name> writes:
> 
>>>> Seems like this needs to be investigated before we can proceed.
>>> I've tested various scenarios and haven't encountered any issues with the
>>> current implementation. It would be great if you could test the change as
>>> well, in case there are edge cases I missed.
>> I think that we need to see an argument in terms of the definition of
>> the file-name-changes backend function that demonstrates that your
>> approach will always work:
>>
>> ;;   Return the list of pairs with changes in file names in REV.  When
>> ;;   a file was added, it should be a cons with nil car.  When
>> ;;   deleted, a cons with nil cdr.  When copied or renamed, a cons
>> ;;   with the source name as car and destination name as cdr.
> My approach updates the FILE argument only if the file name has changed
> in the given revision; otherwise, it keeps the name unchanged. I’m not
> sure if it will **always** work, but it does fix the issue at hand. I'm
> sorry, but I can't provide any further arguments in favor of this
> change.

Looking over the bug report again, my previous question was off the 
mark: it was about longer jumps over revisions - but the 'j' and 'a' 
commands (which are probably the only examples of such in the tree) 
specify the target file name explicitly (getting it from the buffer 
contents), so they should be okay. For the 'n' and 'p' commands, it 
would usually be fine because the step is often 1 revision.

Anyway, that patch seems to fix stepping forward once across a name 
change, but not farther, nor stepping backward over such a change.

To reproduce, add steps like this to the original setup:

  $ echo "
morecontent" > newdir/file.txt
  $ git commit -m 'Edit after the move, adding second line'

And then this to the reproduction:

  5. Press 'n' again.
  6. Press 'p' twice.

It seems the fix is to move the change from 'vc-annotate' to 
'vc-annotate-warp-revision' (previously mentioned by Jakub), and to 
update the new function to handle both directions.

Please try out the the attached update, it seems handle both.

I did some quick testing with Mercurial too.
[vc-annotate-follow-changed-names.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Tue, 29 Jul 2025 13:20:02 GMT) Full text and rfc822 format available.

Message #60 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: Dmitry Gutov <dgutov <at> yandex.ru>, 26345 <at> debbugs.gnu.org,
 wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Tue, 29 Jul 2025 14:18:51 +0100
Hello,

On Sat 26 Jul 2025 at 10:14pm +02, Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>>>> Seems like this needs to be investigated before we can proceed.
>>> I've tested various scenarios and haven't encountered any issues with the
>>> current implementation. It would be great if you could test the change as
>>> well, in case there are edge cases I missed.
>>
>> I think that we need to see an argument in terms of the definition of
>> the file-name-changes backend function that demonstrates that your
>> approach will always work:
>>
>> ;;   Return the list of pairs with changes in file names in REV.  When
>> ;;   a file was added, it should be a cons with nil car.  When
>> ;;   deleted, a cons with nil cdr.  When copied or renamed, a cons
>> ;;   with the source name as car and destination name as cdr.
>
> My approach updates the FILE argument only if the file name has changed
> in the given revision; otherwise, it keeps the name unchanged. I’m not
> sure if it will **always** work, but it does fix the issue at hand. I'm
> sorry, but I can't provide any further arguments in favor of this
> change.

Thanks for your reply.
Would you be able to test Dmitry's patch, please?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Sun, 03 Aug 2025 12:39:02 GMT) Full text and rfc822 format available.

Message #63 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Dmitry Gutov <dgutov <at> yandex.ru>, 26345 <at> debbugs.gnu.org,
 wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Sun, 03 Aug 2025 14:36:38 +0200
Sean Whitton <spwhitton <at> spwhitton.name> writes:

> Would you be able to test Dmitry's patch, please?

With Dmitry's patch applied, everything works as expected.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26345; Package emacs. (Mon, 04 Aug 2025 10:38:01 GMT) Full text and rfc822 format available.

Message #66 received at 26345 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: wojciech.siewierski <at> gmail.com, 26345 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Mon, 04 Aug 2025 11:37:48 +0100
Hello,

On Sun 03 Aug 2025 at 02:36pm +02, Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>> Would you be able to test Dmitry's patch, please?
>
> With Dmitry's patch applied, everything works as expected.

Thanks for reporting back.

Dmitry, I can install this if you are busy, else please go ahead, with
many thanks for coming up with the fix!

-- 
Sean Whitton




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Tue, 05 Aug 2025 01:21:01 GMT) Full text and rfc822 format available.

Notification sent to Wojciech Siewierski <wojciech.siewierski <at> gmail.com>:
bug acknowledged by developer. (Tue, 05 Aug 2025 01:21:02 GMT) Full text and rfc822 format available.

Message #71 received at 26345-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Sean Whitton <spwhitton <at> spwhitton.name>,
 Jakub Ječmínek <kuba <at> kubajecminek.cz>
Cc: 26345-done <at> debbugs.gnu.org, wojciech.siewierski <at> gmail.com
Subject: Re: bug#26345: [PATCH] Handle renamed files when cycling through
 revisions
Date: Tue, 5 Aug 2025 04:19:51 +0300
On 04/08/2025 13:37, Sean Whitton wrote:
>>> Would you be able to test Dmitry's patch, please?
>> With Dmitry's patch applied, everything works as expected.
> Thanks for reporting back.
> 
> Dmitry, I can install this if you are busy, else please go ahead, with
> many thanks for coming up with the fix!

Thanks for confirming, now pushed to master:

https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=65c110b913f0aa539c34a77be812144c621021f8

All seems to be resolved, so closing.




This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.