From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#24725: 25.1.50; vc-region-history may exceed max line number of file in repository Date: Thu, 20 Oct 2016 09:27:22 +0200 Message-ID: References: <87y41llol4.fsf@gmail.com> <8737jrejkd.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476948699 17654 195.159.176.226 (20 Oct 2016 07:31:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2016 07:31:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cc: 24725@debbugs.gnu.org, Dmitry Gutov To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 09:31:33 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx7on-0001Rf-2N for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2016 09:31:13 +0200 Original-Received: from localhost ([::1]:52925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx7op-0007qH-AN for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2016 03:31:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx7lm-0005od-TO for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 03:28:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx7li-0001HB-Vu for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 03:28:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bx7li-0001H7-SX for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 03:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bx7li-0000u4-NB for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 03:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2016 07:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24725 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24725-submit@debbugs.gnu.org id=B24725.14769484453416 (code B ref 24725); Thu, 20 Oct 2016 07:28:02 +0000 Original-Received: (at 24725) by debbugs.gnu.org; 20 Oct 2016 07:27:25 +0000 Original-Received: from localhost ([127.0.0.1]:40283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx7l7-0000t2-1a for submit@debbugs.gnu.org; Thu, 20 Oct 2016 03:27:25 -0400 Original-Received: from mx2.suse.de ([195.135.220.15]:48357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx7l5-0000su-FX for 24725@debbugs.gnu.org; Thu, 20 Oct 2016 03:27:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Original-Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8DE3EABFC; Thu, 20 Oct 2016 07:27:22 +0000 (UTC) X-Yow: FISH-NET-FISH-NET-FISH-NET-FISH-NET-FISH!! In-Reply-To: <8737jrejkd.fsf@gmail.com> (Tino Calancha's message of "Thu, 20 Oct 2016 13:22:10 +0900") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124714 Archived-At: On Okt 20 2016, Tino Calancha 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, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."