Subject: Re: bug#78890: 31.0.50; Messy vc-annotate buffer names

From: Stephen Berman <[email-masked]>
Date: Wed, 25 Jun 2025 11:59:05 +0200

On Wed, 25 Jun 2025 10:46:04 +0100 Sean Whitton <[email-masked]> wrote:

> Hello,
>
> On Wed 25 Jun 2025 at 12:08am +02, Stephen Berman wrote:
>
>> Good, and thanks for testing!  Sean, Eli, should I push it to master,
>> or is it safe enough for emacs-30?
>
> I would say that this is okay for emacs-30.  Thanks for the patch.

On Wed, 25 Jun 2025 10:48:27 +0100 Sean Whitton <[email-masked]> wrote:

> Hello,
>
> On Tue 24 Jun 2025 at 11:02pm -07, Jim Porter wrote:
>
>> On 6/24/2025 4:50 AM, Stephen Berman via Bug reports for GNU Emacs, the Swiss
>> army knife of text editors wrote:
>>> On Tue, 24 Jun 2025 06:41:41 -0400 Kristoffer Balintona
>>> <[email-masked]> wrote:
>>>
>>>> Would it be possible to have buffer names more like the following
>>>> instead upon calls to vc-annotate-next-revision and
>>>> vc-annotate-prev-revision?
>>>> 1. *Annotate vtable.el (rev f1737342518)*
>>>> 2. *Annotate vtable.el (rev fdab542a56201b1581abdc0df940e0c50abde1c7)*
>>>> 3. *Annotate vtable.el (rev 35e1ab970c1cfc6a1b62fbb920e0d2bb031765da)*
>>> Does the attached patch give the results you want?
>>
>> Here's another possible patch for this. It uses 'vc-parent-buffer', which
>> might be nil when first annotating a file, but that works out nicely, since
>> '(buffer-name nil)' gets the buffer name of the current buffer (i.e. the
>> original source file). I think this should be safe, though I'm not an expert
>> on the VC internals.
>
> Thanks.  We could use vc-parent-buffer somehow, but not unconditionally
> -- it's not always set, but only in certain interactive calls.
>
> Even though it's strange to be fixing this by chopping up text like
> Stephen's patch does, I think I prefer it because it should always work.
> But I'm open to other ways of using vc-parent-buffer with a fallback.

So should I go ahead and push my patch to emacs-30, and if Jim comes up
with a better alternative it can be replaced, or should we just wait for
Jim to improve his patch?

>> I also notice that the previous revisions use the full Git SHA, even though
>> they *should* be abbreviated. That's a separate issue though, so I'll file a
>> bug for that once I have a patch ready.
>
> That would be great, thanks.

I agree and I'm happy to let Jim do that.

Steve Berman