From: Dmitry Gutov <dmitry@gutov.dev>
To: David Koppelman <koppel@ece.lsu.edu>, 39044-done@debbugs.gnu.org
Subject: 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 [thread overview]
Message-ID: <7559221a-e7a2-4a75-11cf-b29769b4874f@gutov.dev> (raw)
In-Reply-To: <82fa7939-8914-0dd4-ef6c-e3d100aa1dc6@gutov.dev>
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.
prev parent reply other threads:[~2023-12-15 20:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 20:48 bug#39044: 27.0.50; On git log-view-diff does not work for moved files David Koppelman
2020-05-13 1:36 ` Dmitry Gutov
2023-12-14 1:23 ` Dmitry Gutov
2023-12-15 20:48 ` Dmitry Gutov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7559221a-e7a2-4a75-11cf-b29769b4874f@gutov.dev \
--to=dmitry@gutov.dev \
--cc=39044-done@debbugs.gnu.org \
--cc=koppel@ece.lsu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).