unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50489: vc-annotate doesn't keep the current line
@ 2021-09-09 17:43 Juri Linkov
  2021-09-09 23:15 ` Dmitry Gutov
  2021-09-13 18:19 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 4+ messages in thread
From: Juri Linkov @ 2021-09-09 17:43 UTC (permalink / raw)
  To: 50489

After 'C-x v g' (vc-annotate), typing 'a' (vc-annotate-revision-previous-to-line)
doesn't keep the current line.  For VC archaeology there is a need to traverse
the history of the current line by typing a sequence of 'a a a ...'
But 'a' doesn't keep the line current, so need to spend time
finding the same line in the buffer to be able to type 'a' on it again.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#50489: vc-annotate doesn't keep the current line
  2021-09-09 17:43 bug#50489: vc-annotate doesn't keep the current line Juri Linkov
@ 2021-09-09 23:15 ` Dmitry Gutov
  2021-09-13 18:19 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Gutov @ 2021-09-09 23:15 UTC (permalink / raw)
  To: Juri Linkov, 50489

On 09.09.2021 20:43, Juri Linkov wrote:
> After 'C-x v g' (vc-annotate), typing 'a' (vc-annotate-revision-previous-to-line)
> doesn't keep the current line.  For VC archaeology there is a need to traverse
> the history of the current line by typing a sequence of 'a a a ...'
> But 'a' doesn't keep the line current, so need to spend time
> finding the same line in the buffer to be able to type 'a' on it again.

I think it does keep the current line (by number).

But the exact text can shift up or down between revisions, so we end up 
hunting for it.

It might be possible to keep up with the hunks by doing full diff before 
switching the revision, then count removals/additions in preceding hunks 
and go there. But it would not work when 'a' brings you to the version 
of the file before it was renamed, for example.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#50489: vc-annotate doesn't keep the current line
  2021-09-09 17:43 bug#50489: vc-annotate doesn't keep the current line Juri Linkov
  2021-09-09 23:15 ` Dmitry Gutov
@ 2021-09-13 18:19 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-09-13 23:45   ` Dmitry Gutov
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-13 18:19 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 50489

Juri Linkov <juri@linkov.net> writes:

> After 'C-x v g' (vc-annotate), typing 'a' (vc-annotate-revision-previous-to-line)
> doesn't keep the current line.  For VC archaeology there is a need to traverse
> the history of the current line by typing a sequence of 'a a a ...'
> But 'a' doesn't keep the line current, so need to spend time
> finding the same line in the buffer to be able to type 'a' on it again.

I think `git blame` provides a --porcelain option that helps track lines
accross revisions.  I expect that using that information would be an
improvement over the current behavior, but the solution won't be perfect
and in some situations it'll still go to a strange line.  Also, I don't
know if this feature is available in other non-git vc backends.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#50489: vc-annotate doesn't keep the current line
  2021-09-13 18:19 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-09-13 23:45   ` Dmitry Gutov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Gutov @ 2021-09-13 23:45 UTC (permalink / raw)
  To: Daniel Martín, Juri Linkov; +Cc: 50489

On 13.09.2021 21:19, Daniel Martín via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Juri Linkov<juri@linkov.net>  writes:
> 
>> After 'C-x v g' (vc-annotate), typing 'a' (vc-annotate-revision-previous-to-line)
>> doesn't keep the current line.  For VC archaeology there is a need to traverse
>> the history of the current line by typing a sequence of 'a a a ...'
>> But 'a' doesn't keep the line current, so need to spend time
>> finding the same line in the buffer to be able to type 'a' on it again.
> I think `git blame` provides a --porcelain option that helps track lines
> accross revisions.  I expect that using that information would be an
> improvement over the current behavior, but the solution won't be perfect
> and in some situations it'll still go to a strange line.  Also, I don't
> know if this feature is available in other non-git vc backends.

Interesting suggestion. I think reliance on known line numbers can be 
made optional for backends that do not provide that info.

--porcelain (or --list-porcelain) output is peculiar and not 
customizable, so it would take some work to convert in to the same view 
we are currently enjoying. Hopefully without any loss in performance 
(I'm guessing the slowest part is still going to be the scanning of 
history).





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-13 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 17:43 bug#50489: vc-annotate doesn't keep the current line Juri Linkov
2021-09-09 23:15 ` Dmitry Gutov
2021-09-13 18:19 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 23:45   ` Dmitry Gutov

Code repositories for project(s) associated with this 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 NNTP newsgroup(s).