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

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

bug#39044: closed (27.0.50; On git log-view-diff does not work for moved


From: GNU bug Tracking System
Subject: bug#39044: closed (27.0.50; On git log-view-diff does not work for moved files.)
Date: Fri, 15 Dec 2023 20:49:02 +0000

Your message dated Fri, 15 Dec 2023 22:48:08 +0200
with message-id <7559221a-e7a2-4a75-11cf-b29769b4874f@gutov.dev>
and subject line Re: bug#39044: 27.0.50; On git log-view-diff does not work for 
moved files.
has caused the debbugs.gnu.org bug report #39044,
regarding 27.0.50; On git log-view-diff does not work for moved files.
to be marked as done.

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


-- 
39044: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39044
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 27.0.50; On git log-view-diff does not work for moved files. Date: Wed, 08 Jan 2020 14:48:45 -0600
With (setq vc-git-print-log-follow t) visit a file in a git repo that
was moved from some other directory and which had changes when in that
other directory. Start log view, C-x v =, move the cursor to a commit
made in the file's former location, and press d (log-view-diff). Rather
than showing a diff, a message reporting no changes is shown.

This flaw was noted in bug 8756, covering vc-diff/log-view, but was
left to a follow on bug.
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756).

Interestingly, vc-annotate has no trouble with renames. See
commit d1e4c4037e88f3256db19813805d03f8ad0291fa.



In GNU Emacs 27.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-12-20 built on cyc.ece.lsu.edu
Repository revision: 85a60da92d4db5c87ecfa152501d246425550fc3
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Scientific Linux 7.7 (Nitrogen)

Configured using:
 'configure CFLAGS=-O3 --without-pop'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS JSON PDUMPER LCMS2
GMP

Important settings:
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: log

Minor modes in effect:
  shell-dirtrack-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  which-function-mode: t
  flyspell-mode: t
  tooltip-mode: t
  global-eldoc-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

Features:
(shadow emacsbug smerge-mode diff whitespace bug-reference vc-annotate
log-view pcvs-util vc vc-dispatcher vc-git diff-mode mhtml-mode css-mode
smie eww mm-url url-queue js cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode p-viewer misearch
multi-isearch bbdb-gui flow-fill gnus-uu yenc mailalias smtpmail
sendmail nnir shr-color color sort gnus-cite smiley mm-archive
gnus-async gnus-bcklg qp cl-extra gnus-ml disp-table gnus-topic utf-7
gnutls network-stream nsm imap rfc2104 nndoc nndraft nnmh nnmbox
bbdb-gnus bbdb-snarf mail-extr bbdb-com gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime dig nntp gnus-cache gnus-sum url url-proxy url-privacy url-expand
url-methods url-history mailcap shr url-cookie url-domsuf url-util svg
xml dom gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range gnus-win gnus nnheader wid-edit add-log help-mode mule-util
cal-move p-iimage easy-mmode simtools p-tex-funcs shell pcomplete comint
ring man ansi-color hi-lock p-stop-time time-stamp dired-aux p-page
dabbrev ps-print ps-print-loaddefs ps-def lpr holidays hol-loaddefs appt
p-diary-aux cal-x p-diary-audit diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs paren mic-paren message rmc puny dired
dired-loaddefs format-spec rfc822 mml mml-sec epa epg epg-config
gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader ffap
thingatpt ccl-mode ampl-mode bbdb-autoloads bbdb timezone texize
chemora-mode which-func imenu flyspell ispell gnuplot-mode edmacro
kmacro p-autoreload derived sd image-file advice package easymenu
browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer 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 composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray 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 threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 321268 49388)
 (symbols 48 28911 1)
 (strings 32 92367 7980)
 (string-bytes 1 3634829)
 (vectors 16 47078)
 (vector-slots 8 1360945 151650)
 (floats 8 775 1958)
 (intervals 56 11966 7520)
 (buffers 1000 79)
 (heap 1024 59319 13646))



--- End Message ---
--- Begin Message --- Subject: Re: bug#39044: 27.0.50; On git log-view-diff does not work for moved files. Date: Fri, 15 Dec 2023 22:48:08 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0
Version: 30.1

On 14/12/2023 03:23, Dmitry Gutov wrote:
On 13/05/2020 04:36, Dmitry Gutov wrote:
On 08.01.2020 22:48, David Koppelman wrote:

With (setq vc-git-print-log-follow t) visit a file in a git repo that
was moved from some other directory and which had changes when in that
other directory. Start log view, C-x v =, move the cursor to a commit
made in the file's former location, and press d (log-view-diff). Rather
than showing a diff, a message reporting no changes is shown.

I usually give up and press 'D' in those cases (diff for the whole tree).

This flaw was noted in bug 8756, covering vc-diff/log-view, but was
left to a follow on bug.
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756).

Interestingly, vc-annotate has no trouble with renames. See
commit d1e4c4037e88f3256db19813805d03f8ad0291fa.

vc-annotate is fine because 'git blame' includes the previous file name in the output. Not so for 'git log' by default.

Looking at this issue for some time, I haven't found an easier way to do this rather than:

1. When vc-git-print-log-follow=t, also add the --name-status argument to the command invocation.

2. Hide this new text from the user using font lock by adding some rules to vc-git-log-view-mode.

3. _Probably_ teach log-view-current-file how to determine the current file name. _Maybe_ via log-view-file-re. Some come would also need to set log-view-per-file-logs to t for per-file Git logs. It could also be made into a backend method instead.

See also bug#13004 for the same problem when using Hg. It could use the same approach, but the solution is more questionable since '--stat' seems to noticeably slow it down.

I have now posted a somewhat related solution to https://debbugs.gnu.org/55871#41.

Except it requires vc-git-print-log-follow to be disabled, and has virtually no runtime overhead. And it works when a fileset contains several files, not just for singles (a rare case, though).

Feedback welcome.

And maybe these bug reports should be merged, actually, since the complaint is more or less the same.

Feedback is still welcome, but I have now pushed a revised version to master (5b80894d0a7), so marking this as resolved.


--- End Message ---

reply via email to

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