mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Have 'last-change' accept a line number instead of a range
* lisp/emacs-lisp/package-vc.el (package-vc-release-rev): Use new signature. * lisp/vc/vc-git.el (vc-git-last-change): Update signature * lisp/vc/vc.el (vc-default-last-change): Update signature and use 'annotate-command'.
This commit is contained in:
parent
bb86ed20e1
commit
d33998ed3b
3 changed files with 21 additions and 22 deletions
|
|
@ -1632,17 +1632,13 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
|
|||
(expand-file-name fname (vc-git-root default-directory))))
|
||||
revision)))))
|
||||
|
||||
(defun vc-git-last-change (from to)
|
||||
(defun vc-git-last-change (file line)
|
||||
(vc-buffer-sync)
|
||||
(let ((file (file-relative-name
|
||||
(buffer-file-name)
|
||||
(vc-git-root (buffer-file-name))))
|
||||
(start (line-number-at-pos from t))
|
||||
(end (line-number-at-pos to t)))
|
||||
(let ((file (file-relative-name file (vc-git-root (buffer-file-name)))))
|
||||
(with-temp-buffer
|
||||
(when (vc-git--out-ok
|
||||
"blame" "--porcelain"
|
||||
(format "-L%d,%d" start end)
|
||||
(format "-L%d,+1" line)
|
||||
file)
|
||||
(goto-char (point-min))
|
||||
(save-match-data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue