unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 19045@debbugs.gnu.org
Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 03 Feb 2018 23:59:58 +0200	[thread overview]
Message-ID: <874lmxloo1.fsf@mail.linkov.net> (raw)
In-Reply-To: <87d28rt4jl.fsf@telefonica.net> ("Óscar Fuentes"'s message of "Thu, 13 Nov 2014 18:05:02 +0100")

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vc-git-print-log-follow.patch --]
[-- Type: text/x-diff, Size: 1491 bytes --]

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"))

  parent reply	other threads:[~2018-02-03 21:59 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 17:05 bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow Óscar Fuentes
2014-11-13 19:07 ` Dmitry Gutov
2014-11-13 21:11   ` Óscar Fuentes
2018-02-03 21:59 ` Juri Linkov [this message]
2018-02-04 21:58   ` Juri Linkov
2018-02-04 23:31     ` Dmitry Gutov
2018-02-05  3:39       ` Eli Zaretskii
2018-02-05  8:25         ` Dmitry Gutov
2018-02-05 16:18           ` Eli Zaretskii
2018-02-05 20:11             ` Dmitry Gutov
2018-02-05 21:31       ` Juri Linkov
2018-02-06 20:46         ` Dmitry Gutov
2018-02-06 21:51           ` Juri Linkov
2018-02-08 22:08             ` Dmitry Gutov
2018-02-10 21:14               ` Juri Linkov
2018-02-12  0:18                 ` Dmitry Gutov
2018-02-15 22:07                   ` Juri Linkov
2018-02-16  8:00                     ` Eli Zaretskii
2018-02-16 10:20                       ` Dmitry Gutov
2018-02-16 10:52                         ` Eli Zaretskii
2018-02-18  0:13                         ` Richard Stallman
2018-02-20 20:39                       ` Juri Linkov
2018-02-21  3:36                         ` Eli Zaretskii
2018-02-05  3:33     ` Eli Zaretskii
2018-02-05 21:17       ` Juri Linkov
2018-02-06  3:40         ` Eli Zaretskii
2018-02-06 21:04           ` Juri Linkov
2018-02-08 15:54             ` Eli Zaretskii
2018-02-08 21:09               ` Juri Linkov
2018-02-09  7:08                 ` Eli Zaretskii
2018-02-10 11:07   ` Eli Zaretskii
2018-02-10 21:08     ` Juri Linkov
2018-02-11 16:24       ` Eli Zaretskii
2018-02-11 17:03         ` Andreas Schwab
2018-02-11 17:25           ` Eli Zaretskii
2018-02-11 18:22             ` Andreas Schwab
2018-02-11 18:49               ` Eli Zaretskii
2018-02-11 21:22                 ` Juri Linkov
2018-02-12 18:09                   ` Eli Zaretskii
2018-02-12 21:50                     ` Juri Linkov
2018-02-13  5:40                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lmxloo1.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=19045@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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 read-only IMAP folder(s) and NNTP newsgroup(s).