From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow Date: Sat, 03 Feb 2018 23:59:58 +0200 Organization: LINKOV.NET Message-ID: <874lmxloo1.fsf@mail.linkov.net> References: <87d28rt4jl.fsf@telefonica.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1517695226 6033 195.159.176.226 (3 Feb 2018 22:00:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Feb 2018 22:00:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: 19045@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 03 23:00:22 2018 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 1ei5qz-0000UP-D5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Feb 2018 23:00:09 +0100 Original-Received: from localhost ([::1]:52541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ei5t0-00063j-4P for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Feb 2018 17:02:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ei5sr-00062y-VH for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 17:02:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ei5sn-0000zi-3G for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 17:02:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ei5sm-0000zc-Uz for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 17:02:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ei5sm-0004HW-K7 for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 17:02:00 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Feb 2018 22:02:00 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19045 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19045-submit@debbugs.gnu.org id=B19045.151769526913583 (code B ref 19045); Sat, 03 Feb 2018 22:02:00 +0000 Original-Received: (at 19045) by debbugs.gnu.org; 3 Feb 2018 22:01:09 +0000 Original-Received: from localhost ([127.0.0.1]:56048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei5rw-0003WI-90 for submit@debbugs.gnu.org; Sat, 03 Feb 2018 17:01:08 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:51884 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei5ru-0003Ta-31 for 19045@debbugs.gnu.org; Sat, 03 Feb 2018 17:01:06 -0500 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 3A48B7EC063 for <19045@debbugs.gnu.org>; Sat, 3 Feb 2018 14:01:05 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 940407EC060 for <19045@debbugs.gnu.org>; Sat, 3 Feb 2018 14:01:04 -0800 (PST) In-Reply-To: <87d28rt4jl.fsf@telefonica.net> ("=?UTF-8?Q?=C3=93scar?= Fuentes"'s message of "Thu, 13 Nov 2014 18:05:02 +0100") 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:142868 Archived-At: --=-=-= Content-Type: text/plain Too bad that a new useful customizable variable vc-git-print-log-follow is not mentioned in NEWS.26. It works quite well, but only with the following fix that puts more restrictions - it checks not only for a directory, but also if it is a single file. The whole patch is intended for the emacs-26 branch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-git-print-log-follow.patch diff --git a/etc/NEWS b/etc/NEWS index 5b3e445..6aa4b2d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1169,6 +1169,9 @@ branch-related commands on a keymap bound to 'B'. *** 'vc-region-history' is now bound to 'C-x v h', replacing the older 'vc-insert-headers' binding. +*** New user option 'vc-git-print-log-follow' follow renames in Git logs +for a single file. + ** CC mode --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 3bf837c..9b54b88 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -994,7 +994,7 @@ This prompts for a branch to merge from." (autoload 'vc-setup-buffer "vc-dispatcher") (defcustom vc-git-print-log-follow nil - "If true, follow renames in Git logs for files." + "If true, follow renames in Git logs for a single file." :type 'boolean :version "26.1") @@ -1019,8 +1019,9 @@ If LIMIT is non-nil, show no more than this many entries." (append '("log" "--no-color") (when (and vc-git-print-log-follow - (not (cl-some #'file-directory-p files))) - ;; "--follow" on directories is broken + (null (cdr files)) + (not (file-directory-p (car files)))) + ;; "--follow" on directories or multiple files is broken ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16422 (list "--follow")) --=-=-=--