Subject: Re: bug#24725: 25.1.50; vc-region-history may exceed max line number of file in repository

From: Andreas Schwab <[email-masked]>
Date: Thu, 20 Oct 2016 09:27:22 +0200

On Okt 20 2016, Tino Calancha <[email-masked]> wrote:

> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index 9eac5b2..c6a9064 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -1016,6 +1016,8 @@ vc-git-region-history
>    ;; FIXME: Maybe this should be done in vc.el (i.e. for all backends), but
>    ;; since Git is the only backend to support this operation so far, it's hard
>    ;; to tell.
> +  (when (> lto (line-number-at-pos (1- (point-max))))
> +    (setq lto (line-number-at-pos (1- (point-max)))))

Shouldn't that be fixed in the caller, and lto always be decremented if
the regions ends at bol?

Andreas.

-- 
Andreas Schwab, SUSE Labs, [email-masked]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."