git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] vc-git.el: Switch to using git-blame instead of git-annotate.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 5, 2006, 09:34 UTC
Message-ID
<7v4pujf6mx.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87k63f9kjf.fsf@wine.dyndns.org>
Alexandre Julliard <julliard@winehq.org> writes:
Show 15 quoted lines
> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
> ---
>  contrib/emacs/vc-git.el |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el
> index 4a8f790..4189c4c 100644
> --- a/contrib/emacs/vc-git.el
> +++ b/contrib/emacs/vc-git.el
> @@ -119,10 +119,10 @@ (defun vc-git-checkout (file &optional e
>  (defun vc-git-annotate-command (file buf &optional rev)
>    ; FIXME: rev is ignored
>    (let ((name (file-relative-name file)))
> -    (call-process "git" nil buf nil "annotate" name)))
> +    (call-process "git" nil buf nil "blame" name)))

"blame -c" is advertised to give the same format as "annotate", so I think you would not need other hunk if you did.

Show 5 quoted lines
>  (defun vc-git-annotate-time ()
> -  (and (re-search-forward "[0-9a-f]+\t(.*\t\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\t[0-9]+)" nil t)
> +  (and (re-search-forward "[0-9a-f]+ (.* \\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\) +[0-9]+)" nil t)
>         (vc-annotate-convert-time
>          (apply #'encode-time (mapcar (lambda (match) (string-to-number (match-string match))) '(6 5 4 3 2 1 7))))))

Not that I am preferring the annotate output format over blame's native output format. I just wanted to know if the reason you did not do -c was because you tried and "blame -c" was not compatible as advertised (in which case we have one more thing to fix).

Previous: Alexandre JulliardNext: Alexandre Julliard
Message 2 of 3 in “vc-git.el: Switch to using git-blame instead of git-annotate.”
  1. vc-git.el: Switch to using git-blame instead of git-annotate.Alexandre Julliard, Oct 5, 2006
  2. Junio C HamanoOct 5, 2006
  3. Alexandre JulliardOct 5, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.