Function: vc-git-print-log
vc-git-print-log is a byte-compiled function defined in vc-git.el.gz.
Signature
(vc-git-print-log FILES BUFFER &optional SHORTLOG START-REVISION LIMIT)
Documentation
Print commit log associated with FILES into specified BUFFER.
If SHORTLOG is non-nil, use a short format based on vc-git-root-log-format.
(This requires at least Git version 1.5.6, for the --graph option.)
If START-REVISION is non-nil, it is the newest revision to show.
If LIMIT is a number, show no more than this many entries.
If LIMIT is a revision string, use it as an end-revision.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-print-log (files buffer &optional shortlog start-revision limit)
"Print commit log associated with FILES into specified BUFFER.
If SHORTLOG is non-nil, use a short format based on `vc-git-root-log-format'.
\(This requires at least Git version 1.5.6, for the --graph option.)
If START-REVISION is non-nil, it is the newest revision to show.
If LIMIT is a number, show no more than this many entries.
If LIMIT is a revision string, use it as an end-revision."
(let ((coding-system-for-read
(or coding-system-for-read vc-git-log-output-coding-system)))
;; `vc-do-command' creates the buffer, but we need it before running
;; the command.
(vc-setup-buffer buffer)
;; If the buffer exists from a previous invocation it might be
;; read-only.
(let ((inhibit-read-only t))
(with-current-buffer buffer
(apply #'vc-git-command buffer
'async files
(append
'("log" "--no-color")
(when (and vc-git-print-log-follow
(null (cdr files))
(car 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"))
(when shortlog
`("--graph" "--decorate" "--date=short"
,(format "--pretty=tformat:%s"
(car vc-git-root-log-format))
"--abbrev-commit"))
vc-git-log-switches
(when (numberp limit)
(list "-n" (format "%s" limit)))
(when start-revision
(if (and limit (not (numberp limit)))
(list (concat start-revision ".." (if (equal limit "")
"HEAD"
limit)))
(list start-revision)))
(when (eq vc-log-view-type 'with-diff)
(list "-p"))
'("--")))))))