[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow

From: Juri Linkov
Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 10 Feb 2018 23:08:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> @@ -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"))
> What does this mean "is broken" in this context?  Is this a Git
> bug/misfeature, or is that vc-git.el problem?  I cannot figure out the
> answer by reading the cited bug reports.
> And the doc string doesn't sound detailed enough to me, as it doesn't
> tell enough about the commands that are affected.

When the argument ‘files’ contains more than one file, then git fails
with the same error as when ‘files’ contains a directory (the case
that was previously handled by ‘cl-some #'file-directory-p’ above).

The detailed recipe for the previous version of vc-git.el is here:

0. emacs -Q
1. C-x d directory_under_Git_control
2. use customization or just (setq vc-git-print-log-follow t)
3. in Dired mark only one file
4. C-x v l   - works ok showing the log
5. mark a second file, so there are 2 marked files in Dired
6. C-x v l   - git fails with the following error message:

  “usage: git logs can only follow renames on one pathname at a time”

in git version 1.9.1

So the fix was to check whether there is only one file given as an argument,
and it is not a directory.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]