[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: Sun, 04 Feb 2018 23:58:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

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

reply via email to

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