summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-git.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r--lisp/vc/vc-git.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3c6afec0378..376892c7206 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1268,6 +1268,12 @@ This prompts for a branch to merge from."
(add-hook 'after-save-hook #'vc-git-resolve-when-done nil 'local))
(vc-message-unresolved-conflicts buffer-file-name)))
+(defun vc-git-clone (remote directory rev)
+ (if rev
+ (vc-git--out-ok "clone" "--branch" rev remote directory)
+ (vc-git--out-ok "clone" remote directory))
+ directory)
+
;;; HISTORY FUNCTIONS
(autoload 'vc-setup-buffer "vc-dispatcher")
@@ -1626,6 +1632,19 @@ 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 (file line)
+ (vc-buffer-sync)
+ (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,+1" line)
+ file)
+ (goto-char (point-min))
+ (save-match-data
+ (when (looking-at "\\`\\([[:alnum:]]+\\)[[:space:]]+")
+ (match-string 1)))))))
+
;;; TAG/BRANCH SYSTEM
(declare-function vc-read-revision "vc"