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>

Full log


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)]

This bug report was last modified 8 days ago.

Previous Next


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