Subject: Re: bug#35624: log-view-diff regression

From: Dmitry Gutov <[email-masked]>
Date: Thu, 16 May 2019 01:05:11 +0300

On 16.05.2019 0:12, Juri Linkov wrote:

>> You can also type 'C-u C-x v =', then '1.4', RET and C-j to omit the end
>> version. That would also show the diff against the workfile.
> 
> 10 keys more to type.

You would normally paste the revision. And 'C-x v =' is already in my 
muscle memory.

> When this feature was enabled, I used it every day.

Was it back in the days of CVS?

> Currently I'm forced
> to type 10 more keys every time.  I agree the log not to look weirder,
> so better to not display Working.

Could you explain what are you using it for? I understand a diff between 
revisions, and I understand a diff of the working tree against the 
index, but this kind of a diff seems pretty unusual.

> Or course, you didn't think about it, because you didn't know it exists.
> I didn't know too until discovered it accidentally.  After that it hard
> to lose this ability.  The problem is that this useful feature is
> undocumented.  Here is the patch that documents it:

I have tried to imagine using it, but it's still hard. Maybe doing it 
once a few days to compare the current progress against the master 
branch. Though C-u C-x v d master RET C-j might be faster that looking 
for the revision that corresponds to the master branch in the log.

> +To compare two arbitrary revisions, activate the region: set the
> +beginning of the region to the line with the first revision and the
> +end of the region to the line with the second revision to compare,
> +then type @kbd{d} or @kbd{=}.  When the beginning of the region is on
> +the top line that has no revision, it uses the current work file as
> +the first revision to compare.  When the end of the region is on the
> +bottom non-revision line after the last revision line, then it uses
> +the next earlier revision after the last displayed revision as the
> +second revision to compare.

The description is okay, but feature-wise, I'm not convinced.

Would somebody else like to express an opinion here?

>   @vindex vc-log-show-limit
>   Because fetching many log entries can be slow, the
>   @file{*vc-change-log*} buffer displays no more than 2000 revisions by
> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index 61c13026cc..b6feb3b8d1 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -1017,8 +1017,8 @@ vc-git-print-log
>       ;; If the buffer exists from a previous invocation it might be
>       ;; read-only.
>       (let ((inhibit-read-only t))
> -      (with-current-buffer
> -          buffer
> +      (with-current-buffer buffer
> +	(insert "\n")

Any other ideas how to reach the same functionality without making the 
log buffer weirder?

Maybe add a prefix argument handling to log-view-diff?