GNU bug report logs - #19045
25.0.50; [PATCH] vc-git-print-log use --follow

Previous Next

Package: emacs;

Reported by: ofv <at> wanadoo.es (Óscar Fuentes)

Date: Thu, 13 Nov 2014 17:06:02 UTC

Severity: normal

Tags: fixed

Merged with 8756

Found in versions 23.3, 25.0.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19045 in the body.
You can then email your comments to 19045 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Thu, 13 Nov 2014 17:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ofv <at> wanadoo.es (Óscar Fuentes):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Nov 2014 17:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ofv <at> wanadoo.es (Óscar Fuentes)
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Thu, 13 Nov 2014 18:05:02 +0100
[Message part 1 (text/plain, inline)]
2014-11-13 Oscar Fuentes <ofv <at> wanadoo.es>

	When showing a log with git, continue beyond renames.
	* lisp/vc/vc-git.el (vc-git-print-log): Use --follow.


[vc-git-log-follow-renames.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Thu, 13 Nov 2014 19:09:01 GMT) Full text and rfc822 format available.

Message #8 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: ofv <at> wanadoo.es (Óscar Fuentes)
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Thu, 13 Nov 2014 21:07:58 +0200
ofv <at> wanadoo.es (Óscar Fuentes) writes:

> 2014-11-13 Oscar Fuentes <ofv <at> wanadoo.es>
>
> 	When showing a log with git, continue beyond renames.
> 	* lisp/vc/vc-git.el (vc-git-print-log): Use --follow.

You should check out the discussion at http://debbugs.gnu.org/8756.




Forcibly Merged 8756 19045. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Thu, 13 Nov 2014 20:46:01 GMT) Full text and rfc822 format available.

Reply sent to Óscar Fuentes <ofv <at> wanadoo.es>:
You have taken responsibility. (Thu, 13 Nov 2014 21:12:01 GMT) Full text and rfc822 format available.

Notification sent to ofv <at> wanadoo.es (Óscar Fuentes):
bug acknowledged by developer. (Thu, 13 Nov 2014 21:12:02 GMT) Full text and rfc822 format available.

Message #15 received at 19045-done <at> debbugs.gnu.org (full text, mbox):

From: Óscar Fuentes <ofv <at> wanadoo.es>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045-done <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Thu, 13 Nov 2014 22:11:33 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> You should check out the discussion at http://debbugs.gnu.org/8756.

Ok, so it is not as simple as it seems.




Reply sent to Óscar Fuentes <ofv <at> wanadoo.es>:
You have taken responsibility. (Thu, 13 Nov 2014 21:12:02 GMT) Full text and rfc822 format available.

Notification sent to Steinar Bang <sb <at> dod.no>:
bug acknowledged by developer. (Thu, 13 Nov 2014 21:12:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Dec 2014 12:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Mon, 01 Jan 2018 22:46:01 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Jan 2018 22:46:01 GMT) Full text and rfc822 format available.

Removed tag(s) patch. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Mon, 01 Jan 2018 22:46:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sat, 03 Feb 2018 22:02:00 GMT) Full text and rfc822 format available.

Message #31 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 03 Feb 2018 23:59:58 +0200
[Message part 1 (text/plain, inline)]
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:

[vc-git-print-log-follow.patch (text/x-diff, inline)]
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"))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 04 Feb 2018 22:01:01 GMT) Full text and rfc822 format available.

Message #34 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 04 Feb 2018 23:58:53 +0200
> 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:

Pushed to the emacs-26 branch.

Here is a related problem.  The executed git command is not shown
completely in the echo area, this is ok since there is not much space.

But the git command is truncated in the *Messages* buffer, this is bad
because sometimes there is a need to inspect the command run by git with
its command line switches in its entirety, especially in case of errors.

The command string is truncated in ‘vc-do-command’ and let-bound to
‘full-command’, so we need to add an untruncated command string
to the *Messages* buffer.

Here is an example of what will be in *Messages* after this patch:

  Running git --no-pager log -p -L1001,1039:vc-git.el
  Running git --no-pager log -p -L... . in background...
  Running git --no-pager log -p -L... . in background... done

This patch is for the master branch:

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..efdd29e 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -313,6 +313,8 @@ vc-do-command
 	    (status 0))
 	(when files
 	  (setq squeezed (nconc squeezed files)))
+        (let ((inhibit-message t))
+          (message "Running %s %s" command (vc-delistify squeezed)))
 	(let (;; Since some functions need to parse the output
 	      ;; from external commands, set LC_MESSAGES to C.
 	      (process-environment (cons "LC_MESSAGES=C" process-environment))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 04 Feb 2018 23:32:02 GMT) Full text and rfc822 format available.

Message #37 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>, 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 5 Feb 2018 02:31:14 +0300
On 2/5/18 00:58, Juri Linkov wrote:

> The command string is truncated in ‘vc-do-command’ and let-bound to
> ‘full-command’, so we need to add an untruncated command string
> to the *Messages* buffer.

Looks okay to me. But here's an alternative to consider:

Could we use message-truncate-lines and just one message call instead?

The 20 characters limit seems arbitrary, we just need to avoid resizing 
the echo area. And if the "in background... done" part being truncated 
is a worry, we can rephrase them to go at the beginning of the sentence.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 03:34:01 GMT) Full text and rfc822 format available.

Message #40 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 05 Feb 2018 05:33:38 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Sun, 04 Feb 2018 23:58:53 +0200
> 
> > 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:
> 
> Pushed to the emacs-26 branch.

Please don't push anything to the release branch without John's or
mine explicit approval.  As things are, I'm very busy these days, and
didn't yet have time to review the patch thoroughly, so I'm not sure
I'm happy with its being pushed.

> diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
> index b0d2221..efdd29e 100644
> --- a/lisp/vc/vc-dispatcher.el
> +++ b/lisp/vc/vc-dispatcher.el
> @@ -313,6 +313,8 @@ vc-do-command
>  	    (status 0))
>  	(when files
>  	  (setq squeezed (nconc squeezed files)))
> +        (let ((inhibit-message t))
> +          (message "Running %s %s" command (vc-delistify squeezed)))
>  	(let (;; Since some functions need to parse the output
>  	      ;; from external commands, set LC_MESSAGES to C.
>  	      (process-environment (cons "LC_MESSAGES=C" process-environment))

I don't understand why would we want to hard-code the fact that these
commands are not shown in the echo area.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 03:41:02 GMT) Full text and rfc822 format available.

Message #43 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 05 Feb 2018 05:39:51 +0200
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 5 Feb 2018 02:31:14 +0300
> 
> The 20 characters limit seems arbitrary, we just need to avoid resizing 
> the echo area.

There are means to prevent resizing the mini-window without truncating
anything in *Messages*.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 08:26:01 GMT) Full text and rfc822 format available.

Message #46 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 5 Feb 2018 11:25:39 +0300
On 2/5/18 06:39, Eli Zaretskii wrote:
>> From: Dmitry Gutov <dgutov <at> yandex.ru>
>> Date: Mon, 5 Feb 2018 02:31:14 +0300
>>
>> The 20 characters limit seems arbitrary, we just need to avoid resizing
>> the echo area.
> 
> There are means to prevent resizing the mini-window without truncating
> anything in *Messages*.

message-truncate-lines, right? Which I mentioned.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 16:19:01 GMT) Full text and rfc822 format available.

Message #49 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 05 Feb 2018 18:18:23 +0200
> Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 5 Feb 2018 11:25:39 +0300
> 
> > There are means to prevent resizing the mini-window without truncating
> > anything in *Messages*.
> 
> message-truncate-lines, right? Which I mentioned.

No, I meant resize-mini-windows.  The advantage of binding that around
the offending code is that it doesn't affect what is being logged in
*Messages*.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 20:13:02 GMT) Full text and rfc822 format available.

Message #52 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 5 Feb 2018 23:11:59 +0300
On 2/5/18 19:18, Eli Zaretskii wrote:

>>> There are means to prevent resizing the mini-window without truncating
>>> anything in *Messages*.
>>
>> message-truncate-lines, right? Which I mentioned.
> 
> No, I meant resize-mini-windows.  The advantage of binding that around
> the offending code is that it doesn't affect what is being logged in
> *Messages*.

Oh, I see. I read the former's docstring wrong.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 21:36:01 GMT) Full text and rfc822 format available.

Message #55 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 05 Feb 2018 23:17:38 +0200
>> > 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:
>> 
>> Pushed to the emacs-26 branch.
>
> Please don't push anything to the release branch without John's or
> mine explicit approval.  As things are, I'm very busy these days, and
> didn't yet have time to review the patch thoroughly, so I'm not sure
> I'm happy with its being pushed.

Sorry, will wait more time the next time.

>> diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
>> index b0d2221..efdd29e 100644
>> --- a/lisp/vc/vc-dispatcher.el
>> +++ b/lisp/vc/vc-dispatcher.el
>> @@ -313,6 +313,8 @@ vc-do-command
>>  	    (status 0))
>>  	(when files
>>  	  (setq squeezed (nconc squeezed files)))
>> +        (let ((inhibit-message t))
>> +          (message "Running %s %s" command (vc-delistify squeezed)))
>>  	(let (;; Since some functions need to parse the output
>>  	      ;; from external commands, set LC_MESSAGES to C.
>>  	      (process-environment (cons "LC_MESSAGES=C" process-environment))
>
> I don't understand why would we want to hard-code the fact that these
> commands are not shown in the echo area.

I don't want to cause more flicker in the echo area when the full command
gets overwritten immediately by the truncated command in the echo area. 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 05 Feb 2018 21:36:02 GMT) Full text and rfc822 format available.

Message #58 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 05 Feb 2018 23:31:12 +0200
> Could we use message-truncate-lines and just one message call instead?

Maybe.  But currently what is truncated is not the whole command line,
but each of the command switches.  I don't know how important this is.

> The 20 characters limit seems arbitrary, we just need to avoid resizing the
> echo area. And if the "in background... done" part being truncated is
> a worry, we can rephrase them to go at the beginning of the sentence.

Indeed, truncating "in background... done" is not nice, and I have
no idea how to rephrase it.

Anyway, this is the current patch to try:

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..21f2b98 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,12 @@ vc-do-command
   (let* ((files
 	  (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
 		  (if (listp file-or-list) file-or-list (list file-or-list))))
+	 (message-truncate-lines t)
 	 (full-command
-	  ;; What we're doing here is preparing a version of the command
-	  ;; for display in a debug-progress message.  If it's fewer than
-	  ;; 20 characters display the entire command (without trailing
-	  ;; newline).  Otherwise display the first 20 followed by an ellipsis.
 	  (concat (if (string= (substring command -1) "\n")
 		      (substring command 0 -1)
 		    command)
-		  " "
-		  (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...")  s)) flags))
+		  " " (vc-delistify flags)
 		  " " (vc-delistify files))))
     (save-current-buffer
       (unless (or (eq buffer t)
@@ -332,7 +328,8 @@ vc-do-command
 		(setq status proc)
 		(when vc-command-messages
 		  (vc-run-delayed
-		   (message "Running %s in background... done" full-command))))
+		    (let ((message-truncate-lines t))
+		      (message "Running %s in background... done" full-command)))))
 	    ;; Run synchronously
 	    (when vc-command-messages
 	      (message "Running %s in foreground..." full-command))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Tue, 06 Feb 2018 03:41:02 GMT) Full text and rfc822 format available.

Message #61 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 06 Feb 2018 05:40:08 +0200
> > Please don't push anything to the release branch without John's or
> > mine explicit approval.  As things are, I'm very busy these days, and
> > didn't yet have time to review the patch thoroughly, so I'm not sure
> > I'm happy with its being pushed.
> 
> Sorry, will wait more time the next time.

Thanks in advance.

> >> +        (let ((inhibit-message t))
> >> +          (message "Running %s %s" command (vc-delistify squeezed)))
> >>  	(let (;; Since some functions need to parse the output
> >>  	      ;; from external commands, set LC_MESSAGES to C.
> >>  	      (process-environment (cons "LC_MESSAGES=C" process-environment))
> >
> > I don't understand why would we want to hard-code the fact that these
> > commands are not shown in the echo area.
> 
> I don't want to cause more flicker in the echo area when the full command
> gets overwritten immediately by the truncated command in the echo area. 

Would binding resize-mini-windows to nil instead fix that?  If it
would, then I think it's a better way, because it doesn't affect what
is being recorded in *Messages*.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Tue, 06 Feb 2018 20:47:01 GMT) Full text and rfc822 format available.

Message #64 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 6 Feb 2018 23:46:43 +0300
On 2/6/18 00:31, Juri Linkov wrote:
>> Could we use message-truncate-lines and just one message call instead?
> 
> Maybe.  But currently what is truncated is not the whole command line,
> but each of the command switches.  I don't know how important this is.

Apparently the idea is that "in background... done" is shown in the echo 
area regardless of the command string length.

>> The 20 characters limit seems arbitrary, we just need to avoid resizing the
>> echo area. And if the "in background... done" part being truncated is
>> a worry, we can rephrase them to go at the beginning of the sentence.
> 
> Indeed, truncating "in background... done" is not nice, and I have
> no idea how to rephrase it.

How about:

Running in background: %s

and

Finished in background: %s

> Anyway, this is the current patch to try:

Does it work like you wanted? According to Eli, we should replace 
message-truncate-lines here with resize-mini-windows.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Tue, 06 Feb 2018 21:07:02 GMT) Full text and rfc822 format available.

Message #67 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 06 Feb 2018 23:04:28 +0200
> Would binding resize-mini-windows to nil instead fix that?  If it
> would, then I think it's a better way, because it doesn't affect what
> is being recorded in *Messages*.

I created a patch below that let-binds resize-mini-windows to nil,
but it has no effect and always resizes the echo area.
Should I create a separate bug report for this?

Also there is still a problem of hiding the trailing part with
“in background... done” when it is not displayed at the end of
the message, and I have no idea how to reformulate this phrase.

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..a3d8e3d 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,12 @@ vc-do-command
   (let* ((files
 	  (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
 		  (if (listp file-or-list) file-or-list (list file-or-list))))
+	 (resize-mini-windows nil)
 	 (full-command
-	  ;; What we're doing here is preparing a version of the command
-	  ;; for display in a debug-progress message.  If it's fewer than
-	  ;; 20 characters display the entire command (without trailing
-	  ;; newline).  Otherwise display the first 20 followed by an ellipsis.
 	  (concat (if (string= (substring command -1) "\n")
 		      (substring command 0 -1)
 		    command)
-		  " "
-		  (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...")  s)) flags))
+		  " " (vc-delistify flags)
 		  " " (vc-delistify files))))
     (save-current-buffer
       (unless (or (eq buffer t)
@@ -332,7 +328,8 @@ vc-do-command
 		(setq status proc)
 		(when vc-command-messages
 		  (vc-run-delayed
-		   (message "Running %s in background... done" full-command))))
+		    (let ((resize-mini-windows nil))
+		      (message "Running %s in background... done" full-command)))))
 	    ;; Run synchronously
 	    (when vc-command-messages
 	      (message "Running %s in foreground..." full-command))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Tue, 06 Feb 2018 21:53:02 GMT) Full text and rfc822 format available.

Message #70 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 06 Feb 2018 23:51:50 +0200
>>> The 20 characters limit seems arbitrary, we just need to avoid resizing the
>>> echo area. And if the "in background... done" part being truncated is
>>> a worry, we can rephrase them to go at the beginning of the sentence.
>>
>> Indeed, truncating "in background... done" is not nice, and I have
>> no idea how to rephrase it.
>
> How about:
>
> Running in background: %s
>
> and
>
> Finished in background: %s

Not bad, better would be to try to find words with the same length,
so the whole command won't jump 1 char to the right when finished.

>> Anyway, this is the current patch to try:
>
> Does it work like you wanted? According to Eli, we should replace
> message-truncate-lines here with resize-mini-windows.

message-truncate-lines works fine whereas resize-mini-windows doesn't.
Maybe the fact that it runs processes has its effect on resizing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Thu, 08 Feb 2018 15:55:02 GMT) Full text and rfc822 format available.

Message #73 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Thu, 08 Feb 2018 17:54:21 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 19045 <at> debbugs.gnu.org
> Date: Tue, 06 Feb 2018 23:04:28 +0200
> 
> I created a patch below that let-binds resize-mini-windows to nil,
> but it has no effect and always resizes the echo area.
> Should I create a separate bug report for this?

No, it's not a bug.  Sorry, I forgot how this feature works: this
variable cannot be let-bound.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Thu, 08 Feb 2018 21:39:02 GMT) Full text and rfc822 format available.

Message #76 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Thu, 08 Feb 2018 23:09:04 +0200
>> I created a patch below that let-binds resize-mini-windows to nil,
>> but it has no effect and always resizes the echo area.
>> Should I create a separate bug report for this?
>
> No, it's not a bug.  Sorry, I forgot how this feature works: this
> variable cannot be let-bound.

Then is it ok to install the patch that uses message-truncate-lines?
(to master, of course)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Thu, 08 Feb 2018 22:09:02 GMT) Full text and rfc822 format available.

Message #79 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 9 Feb 2018 01:08:03 +0300
On 2/7/18 00:51, Juri Linkov wrote:

>> How about:
>>
>> Running in background: %s
>>
>> and
>>
>> Finished in background: %s
> 
> Not bad, better would be to try to find words with the same length,
> so the whole command won't jump 1 char to the right when finished.

If we fail to find better wording, maybe add an extra space between 
"Running" and "in".

> message-truncate-lines works fine whereas resize-mini-windows doesn't.
> Maybe the fact that it runs processes has its effect on resizing.

If it works (and doesn't affect the contents of *Messages*, which was 
the goal), great. That's all we need.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Fri, 09 Feb 2018 07:10:02 GMT) Full text and rfc822 format available.

Message #82 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 09 Feb 2018 09:08:58 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 19045 <at> debbugs.gnu.org
> Date: Thu, 08 Feb 2018 23:09:04 +0200
> 
> >> I created a patch below that let-binds resize-mini-windows to nil,
> >> but it has no effect and always resizes the echo area.
> >> Should I create a separate bug report for this?
> >
> > No, it's not a bug.  Sorry, I forgot how this feature works: this
> > variable cannot be let-bound.
> 
> Then is it ok to install the patch that uses message-truncate-lines?
> (to master, of course)

Yes, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sat, 10 Feb 2018 11:08:01 GMT) Full text and rfc822 format available.

Message #85 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 10 Feb 2018 13:07:09 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Sat, 03 Feb 2018 23:59:58 +0200
> 
>  (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"))

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.

Since this is now on the release branch, we should fix these issues
ASAP.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sat, 10 Feb 2018 21:14:01 GMT) Full text and rfc822 format available.

Message #88 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 10 Feb 2018 23:08:32 +0200
>> @@ -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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sat, 10 Feb 2018 21:16:02 GMT) Full text and rfc822 format available.

Message #91 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 10 Feb 2018 23:14:37 +0200
>>> How about:
>>>
>>> Running in background: %s
>>>
>>> and
>>>
>>> Finished in background: %s
>>
>> Not bad, better would be to try to find words with the same length,
>> so the whole command won't jump 1 char to the right when finished.
>
> If we fail to find better wording, maybe add an extra space between
> "Running" and "in".

Yes, an extra space space will help.

In addition to these background messages, we also have to find
better wording for foreground messages as well:

"Running %s in foreground..."
"Running %s...OK = %d"
"Running %s...FAILED (%s)"

where additional argument is status.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 11 Feb 2018 16:26:02 GMT) Full text and rfc822 format available.

Message #94 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 11 Feb 2018 18:24:40 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 19045 <at> debbugs.gnu.org
> Date: Sat, 10 Feb 2018 23:08:32 +0200
> 
> 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

Thanks for the example, this works fine here with Git 2.10.0.

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

So I think we should disable multiple files only on old versions of
Git that don't support this.  Do we know which version started
supporting this?  And what about directories?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 11 Feb 2018 17:04:01 GMT) Full text and rfc822 format available.

Message #97 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 11 Feb 2018 18:03:00 +0100
On Feb 11 2018, Eli Zaretskii <eliz <at> gnu.org> wrote:

> So I think we should disable multiple files only on old versions of
> Git that don't support this.  Do we know which version started
> supporting this?  And what about directories?

git log --follow still requires exactly one pathspec (but it can match
multiple files).  A directory is a pathspec that matches all files in
that directory (recursively).

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 11 Feb 2018 17:27:01 GMT) Full text and rfc822 format available.

Message #100 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 11 Feb 2018 19:25:46 +0200
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Juri Linkov <juri <at> linkov.net>,  19045 <at> debbugs.gnu.org
> Date: Sun, 11 Feb 2018 18:03:00 +0100
> 
> On Feb 11 2018, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > So I think we should disable multiple files only on old versions of
> > Git that don't support this.  Do we know which version started
> > supporting this?  And what about directories?
> 
> git log --follow still requires exactly one pathspec (but it can match
> multiple files).  A directory is a pathspec that matches all files in
> that directory (recursively).

Thanks.  I see that marking several files indeed fails, but marking a
single directory does work.  Did that use to fail in Git 1.9?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 11 Feb 2018 18:23:02 GMT) Full text and rfc822 format available.

Message #103 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 11 Feb 2018 19:22:49 +0100
On Feb 11 2018, Eli Zaretskii <eliz <at> gnu.org> wrote:

> Thanks.  I see that marking several files indeed fails, but marking a
> single directory does work.  Did that use to fail in Git 1.9?

I'm not aware of any change in the handling of --follow in connection
with pathspecs.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 11 Feb 2018 18:51:02 GMT) Full text and rfc822 format available.

Message #106 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 11 Feb 2018 20:49:52 +0200
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: juri <at> linkov.net,  19045 <at> debbugs.gnu.org
> Date: Sun, 11 Feb 2018 19:22:49 +0100
> 
> On Feb 11 2018, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > Thanks.  I see that marking several files indeed fails, but marking a
> > single directory does work.  Did that use to fail in Git 1.9?
> 
> I'm not aware of any change in the handling of --follow in connection
> with pathspecs.

OK, thanks.

Juri, can you please re-check with directories?  They seem to work
fine here, so disabling them in this case sounds unnecessary.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 11 Feb 2018 21:26:01 GMT) Full text and rfc822 format available.

Message #109 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sun, 11 Feb 2018 23:22:59 +0200
> Juri, can you please re-check with directories?  They seem to work
> fine here, so disabling them in this case sounds unnecessary.

Please clarify where directories work fine: in git command line
or in Emacs using vc-git?

In the command line of git version 1.9.1 running git log on two files
(command line copied from *Messages* when vc-command-messages is t)

  git --no-pager log --no-color --follow -n 2000 -- vc-dispatcher.el vc-git.el

fails with the error:

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

whereas running git on one directory ‘vc’

  git --no-pager log --no-color --follow -n 2000 -- vc

doesn't fail.  Although I can't confirm the correctness of the output log:
it seems the option ‘--follow’ has no effect on directories.

Now there is a different story for vc-git.el.  There are 4 versions of it:

1. the initial version without the option added in ‘vc-git-print-log’
2. the old version that always used "--follow"
3. the previous version that added "--follow" only
   when the arg ‘files’ contains no directories
4. the current version that additionally checks the length of ‘files’
   and adds "--follow" only for a single file in ‘files’.

Which version did you check?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 12 Feb 2018 00:19:01 GMT) Full text and rfc822 format available.

Message #112 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 12 Feb 2018 03:18:16 +0300
On 2/11/18 12:14 AM, Juri Linkov wrote:

> "Running %s in foreground..."

Same as with "background".

> "Running %s...OK = %d"

Success (status 0): ...

> "Running %s...FAILED (%s)"

Failed  (status 3): ...

Something like that. If the exit code is longer than 1 digit (pretty 
rare), maybe remove the extra space after "Failed".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 12 Feb 2018 18:10:01 GMT) Full text and rfc822 format available.

Message #115 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 12 Feb 2018 20:09:15 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: Andreas Schwab <schwab <at> linux-m68k.org>,  19045 <at> debbugs.gnu.org
> Date: Sun, 11 Feb 2018 23:22:59 +0200
> 
> > Juri, can you please re-check with directories?  They seem to work
> > fine here, so disabling them in this case sounds unnecessary.
> 
> Please clarify where directories work fine: in git command line
> or in Emacs using vc-git?

The latter.

> 
> In the command line of git version 1.9.1 running git log on two files
> (command line copied from *Messages* when vc-command-messages is t)
> 
>   git --no-pager log --no-color --follow -n 2000 -- vc-dispatcher.el vc-git.el
> 
> fails with the error:
> 
>   usage: git logs can only follow renames on one pathname at a time
> 
> whereas running git on one directory ‘vc’
> 
>   git --no-pager log --no-color --follow -n 2000 -- vc
> 
> doesn't fail.  Although I can't confirm the correctness of the output log:
> it seems the option ‘--follow’ has no effect on directories.

Even if it's true, it means --follow doesn't do any harm when invoked
on directories, and we shouldn't disallow that.

> Now there is a different story for vc-git.el.  There are 4 versions of it:
> 
> 1. the initial version without the option added in ‘vc-git-print-log’
> 2. the old version that always used "--follow"
> 3. the previous version that added "--follow" only
>    when the arg ‘files’ contains no directories
> 4. the current version that additionally checks the length of ‘files’
>    and adds "--follow" only for a single file in ‘files’.
> 
> Which version did you check?

I tried #2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Mon, 12 Feb 2018 22:11:02 GMT) Full text and rfc822 format available.

Message #118 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 12 Feb 2018 23:50:55 +0200
>> In the command line of git version 1.9.1 running git log on two files
>> (command line copied from *Messages* when vc-command-messages is t)
>> 
>>   git --no-pager log --no-color --follow -n 2000 -- vc-dispatcher.el vc-git.el
>> 
>> fails with the error:
>> 
>>   usage: git logs can only follow renames on one pathname at a time
>> 
>> whereas running git on one directory ‘vc’
>> 
>>   git --no-pager log --no-color --follow -n 2000 -- vc
>> 
>> doesn't fail.  Although I can't confirm the correctness of the output log:
>> it seems the option ‘--follow’ has no effect on directories.
>
> Even if it's true, it means --follow doesn't do any harm when invoked
> on directories, and we shouldn't disallow that.

I don't know the reason why disallowing directories was implemented
in the first place.  Maybe ‘git log --follow’ failed on directories
in some older git versions?  Wouldn't it be safer to leave the code
that checks for directories and doesn't add ‘--follow’ for this case?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Tue, 13 Feb 2018 05:41:02 GMT) Full text and rfc822 format available.

Message #121 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 13 Feb 2018 07:40:27 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: schwab <at> linux-m68k.org,  19045 <at> debbugs.gnu.org
> Date: Mon, 12 Feb 2018 23:50:55 +0200
> 
> > Even if it's true, it means --follow doesn't do any harm when invoked
> > on directories, and we shouldn't disallow that.
> 
> I don't know the reason why disallowing directories was implemented
> in the first place.  Maybe ‘git log --follow’ failed on directories
> in some older git versions?  Wouldn't it be safer to leave the code
> that checks for directories and doesn't add ‘--follow’ for this case?

Sorry, I was confused and thought that you also added the
non-directory restriction.  I agree that we should not modify the code
that checks for directories, certainly not on the release branch.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Thu, 15 Feb 2018 22:33:01 GMT) Full text and rfc822 format available.

Message #124 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 16 Feb 2018 00:07:20 +0200
>> "Running %s in foreground..."
>
> Same as with "background".
>
>> "Running %s...OK = %d"
>
> Success (status 0): ...
>
>> "Running %s...FAILED (%s)"
>
> Failed  (status 3): ...
>
> Something like that. If the exit code is longer than 1 digit (pretty rare),
> maybe remove the extra space after "Failed".

Like this?

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..c1de2f0 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,12 @@ vc-do-command
   (let* ((files
 	  (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
 		  (if (listp file-or-list) file-or-list (list file-or-list))))
+	 (message-truncate-lines t)
 	 (full-command
-	  ;; What we're doing here is preparing a version of the command
-	  ;; for display in a debug-progress message.  If it's fewer than
-	  ;; 20 characters display the entire command (without trailing
-	  ;; newline).  Otherwise display the first 20 followed by an ellipsis.
 	  (concat (if (string= (substring command -1) "\n")
 		      (substring command 0 -1)
 		    command)
-		  " "
-		  (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...")  s)) flags))
+		  " " (vc-delistify flags)
 		  " " (vc-delistify files))))
     (save-current-buffer
       (unless (or (eq buffer t)
@@ -324,7 +320,7 @@ vc-do-command
 		       (apply 'start-file-process command (current-buffer)
                               command squeezed))))
 		(when vc-command-messages
-		  (message "Running %s in background..." full-command))
+		  (message "Running  in background: %s" full-command))
                 ;; Get rid of the default message insertion, in case we don't
                 ;; set a sentinel explicitly.
 		(set-process-sentinel proc #'ignore)
@@ -332,10 +328,11 @@ vc-do-command
 		(setq status proc)
 		(when vc-command-messages
 		  (vc-run-delayed
-		   (message "Running %s in background... done" full-command))))
+		    (let ((message-truncate-lines t))
+		      (message "Finished in background: %s" full-command)))))
 	    ;; Run synchronously
 	    (when vc-command-messages
-	      (message "Running %s in foreground..." full-command))
+	      (message "Running in foreground: %s" full-command))
 	    (let ((buffer-undo-list t))
 	      (setq status (apply 'process-file command nil t nil squeezed)))
 	    (when (and (not (eq t okstatus))
@@ -345,13 +342,14 @@ vc-do-command
                 (pop-to-buffer (current-buffer))
                 (goto-char (point-min))
                 (shrink-window-if-larger-than-buffer))
-	      (error "Running %s...FAILED (%s)" full-command
-		     (if (integerp status) (format "status %d" status) status)))
+	      (error "Failed (%s): %s"
+                     (if (integerp status) (format "status %d" status) status)
+		     full-command))
 	    (when vc-command-messages
-	      (message "Running %s...OK = %d" full-command status))))
+	      (message "Success (%d): %s" status full-command))))
 	(vc-run-delayed
-	 (run-hook-with-args 'vc-post-command-functions
-                             command file-or-list flags))
+	  (run-hook-with-args 'vc-post-command-functions
+			      command file-or-list flags))
 	status))))
 
 (defun vc-do-async-command (buffer root command &rest args)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Fri, 16 Feb 2018 08:02:02 GMT) Full text and rfc822 format available.

Message #127 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 16 Feb 2018 10:00:55 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Fri, 16 Feb 2018 00:07:20 +0200
> Cc: 19045 <at> debbugs.gnu.org
> 
> @@ -290,16 +290,12 @@ vc-do-command
>    (let* ((files
>  	  (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
>  		  (if (listp file-or-list) file-or-list (list file-or-list))))
> +	 (message-truncate-lines t)

This should have a comment explaining why it is needed.  It should
also mention that messages in this function are formatted in a certain
way so as to put the important parts at the beginning, due to
potential truncation of long messages.

> -		  (message "Running %s in background..." full-command))
> +		  (message "Running  in background: %s" full-command))
                                   ^^
Extra blank.

> -		   (message "Running %s in background... done" full-command))))
> +		    (let ((message-truncate-lines t))
> +		      (message "Finished in background: %s" full-command)))))

I find the original more in line with what we do elsewhere in Emacs.
If the problem is that "done" could be truncated, then please use

  Done in background: %s

> -	      (error "Running %s...FAILED (%s)" full-command
> -		     (if (integerp status) (format "status %d" status) status)))
> +	      (error "Failed (%s): %s"
> +                     (if (integerp status) (format "status %d" status) status)
> +		     full-command))
>  	    (when vc-command-messages
> -	      (message "Running %s...OK = %d" full-command status))))
> +	      (message "Success (%d): %s" status full-command))))

"Failed" and "Success" don't go together well, as they use different
grammatical form.  How about using "Done" here as well?  And won't
status always be zero when it succeeds?  If not, I'd use

  Done (status=%d): %s

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Fri, 16 Feb 2018 10:21:01 GMT) Full text and rfc822 format available.

Message #130 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>, Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 16 Feb 2018 12:20:21 +0200
On 2/16/18 11:00 AM, Eli Zaretskii wrote:

>> -		  (message "Running %s in background..." full-command))
>> +		  (message "Running  in background: %s" full-command))
>                                     ^^
> Extra blank.

As previously discussed, it helps the full-command contents line up in 
the Messages buffer. "Running " is the same width as "Finished".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Fri, 16 Feb 2018 10:53:02 GMT) Full text and rfc822 format available.

Message #133 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Fri, 16 Feb 2018 12:52:09 +0200
> Cc: 19045 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Fri, 16 Feb 2018 12:20:21 +0200
> 
> On 2/16/18 11:00 AM, Eli Zaretskii wrote:
> 
> >> -		  (message "Running %s in background..." full-command))
> >> +		  (message "Running  in background: %s" full-command))
> >                                     ^^
> > Extra blank.
> 
> As previously discussed, it helps the full-command contents line up in 
> the Messages buffer. "Running " is the same width as "Finished".

Then please mention that in the comments to the code,as this surely
looks like a typo.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Sun, 18 Feb 2018 00:14:01 GMT) Full text and rfc822 format available.

Message #136 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19045 <at> debbugs.gnu.org, eliz <at> gnu.org, juri <at> linkov.net
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Sat, 17 Feb 2018 19:13:23 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > As previously discussed, it helps the full-command contents line up in 
  > the Messages buffer. "Running " is the same width as "Finished".

If that's the reason for the apparently erroneous code, 
please add a comment to say so.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Tue, 20 Feb 2018 21:37:03 GMT) Full text and rfc822 format available.

Message #139 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19045 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 20 Feb 2018 22:39:25 +0200
[Message part 1 (text/plain, inline)]
>> -		  (message "Running %s in background..." full-command))
>> +		  (message "Running  in background: %s" full-command))
>                                    ^^
> Extra blank.
>
>> -		   (message "Running %s in background... done" full-command))))
>> +		    (let ((message-truncate-lines t))
>> +		      (message "Finished in background: %s" full-command)))))
>
> I find the original more in line with what we do elsewhere in Emacs.
> If the problem is that "done" could be truncated, then please use
>
>   Done in background: %s

Then extra blank is not needed when using “Done in background” because it
would require too many blanks to align with “Finished in background”.

>> -	      (error "Running %s...FAILED (%s)" full-command
>> -		     (if (integerp status) (format "status %d" status) status)))
>> +	      (error "Failed (%s): %s"
>> +                     (if (integerp status) (format "status %d" status) status)
>> +		     full-command))
>>  	    (when vc-command-messages
>> -	      (message "Running %s...OK = %d" full-command status))))
>> +	      (message "Success (%d): %s" status full-command))))
>
> "Failed" and "Success" don't go together well, as they use different
> grammatical form.  How about using "Done" here as well?  And won't
> status always be zero when it succeeds?  If not, I'd use

I see that the status in case of success is 1.

>   Done (status=%d): %s

Done in the following patch:

[vc-dispatcher.patch (text/x-diff, inline)]
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..da9d346 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,16 @@ vc-do-command
   (let* ((files
 	  (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
 		  (if (listp file-or-list) file-or-list (list file-or-list))))
+	 ;; Keep entire commands in *Messages* but avoid resizing the
+	 ;; echo area.  Messages in this function are formatted in
+	 ;; a such way that the important parts are at the beginning,
+	 ;; due to potential truncation of long messages.
+	 (message-truncate-lines t)
 	 (full-command
-	  ;; What we're doing here is preparing a version of the command
-	  ;; for display in a debug-progress message.  If it's fewer than
-	  ;; 20 characters display the entire command (without trailing
-	  ;; newline).  Otherwise display the first 20 followed by an ellipsis.
 	  (concat (if (string= (substring command -1) "\n")
 		      (substring command 0 -1)
 		    command)
-		  " "
-		  (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...")  s)) flags))
+		  " " (vc-delistify flags)
 		  " " (vc-delistify files))))
     (save-current-buffer
       (unless (or (eq buffer t)
@@ -324,7 +324,7 @@ vc-do-command
 		       (apply 'start-file-process command (current-buffer)
                               command squeezed))))
 		(when vc-command-messages
-		  (message "Running %s in background..." full-command))
+		  (message "Running in background: %s" full-command))
                 ;; Get rid of the default message insertion, in case we don't
                 ;; set a sentinel explicitly.
 		(set-process-sentinel proc #'ignore)
@@ -332,10 +332,11 @@ vc-do-command
 		(setq status proc)
 		(when vc-command-messages
 		  (vc-run-delayed
-		   (message "Running %s in background... done" full-command))))
+		    (let ((message-truncate-lines t))
+		      (message "Done in background: %s" full-command)))))
 	    ;; Run synchronously
 	    (when vc-command-messages
-	      (message "Running %s in foreground..." full-command))
+	      (message "Running in foreground: %s" full-command))
 	    (let ((buffer-undo-list t))
 	      (setq status (apply 'process-file command nil t nil squeezed)))
 	    (when (and (not (eq t okstatus))
@@ -345,13 +346,14 @@ vc-do-command
                 (pop-to-buffer (current-buffer))
                 (goto-char (point-min))
                 (shrink-window-if-larger-than-buffer))
-	      (error "Running %s...FAILED (%s)" full-command
-		     (if (integerp status) (format "status %d" status) status)))
+	      (error "Failed (%s): %s"
+		     (if (integerp status) (format "status %d" status) status)
+		     full-command))
 	    (when vc-command-messages
-	      (message "Running %s...OK = %d" full-command status))))
+	      (message "Done (status=%d): %s" status full-command))))
 	(vc-run-delayed
-	 (run-hook-with-args 'vc-post-command-functions
-                             command file-or-list flags))
+	  (run-hook-with-args 'vc-post-command-functions
+			      command file-or-list flags))
 	status))))
 
 (defun vc-do-async-command (buffer root command &rest args)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19045; Package emacs. (Wed, 21 Feb 2018 03:37:01 GMT) Full text and rfc822 format available.

Message #142 received at 19045 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19045 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Wed, 21 Feb 2018 05:36:53 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: dgutov <at> yandex.ru,  19045 <at> debbugs.gnu.org
> Date: Tue, 20 Feb 2018 22:39:25 +0200
> 
> Done in the following patch:

LGTM, thanks.




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 03 Nov 2019 14:33:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 8756 <at> debbugs.gnu.org and Steinar Bang <sb <at> dod.no> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 03 Nov 2019 14:33:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Dec 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.