path: root/contrib/emacs/vc-git.el
diff options
authorVille Skytt,Ad(B <>2006-07-04 22:35:52 (GMT)
committerJunio C Hamano <>2006-07-05 23:17:56 (GMT)
commitb5dd9d2027c1bd5758033c7baf6d087752b0263d (patch)
treef79b1ff69e3d243eedfb1ebae0aefa1a1f84f657 /contrib/emacs/vc-git.el
parent4bbf599f7bb6bd6debb3624b27815f366b7b34a1 (diff)
Fix print-log and diff compatibility with recent vc versions
Here's a patch that fixes print-log and diff compatibility with recent vc versions, such as current GNU Emacs CVS. Signed-off-by: Ville Skytt,Ad(B <>
Diffstat (limited to 'contrib/emacs/vc-git.el')
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el
index 2453cdc..3f6ed69 100644
--- a/contrib/emacs/vc-git.el
+++ b/contrib/emacs/vc-git.el
@@ -95,16 +95,17 @@
"Register FILE into the git version-control system."
(vc-git--run-command file "update-index" "--add" "--"))
-(defun vc-git-print-log (file)
+(defun vc-git-print-log (file &optional buffer)
(let ((name (file-relative-name file))
(coding-system-for-read git-commits-coding-system))
- (vc-do-command nil 'async "git" name "rev-list" "--pretty" "HEAD" "--")))
+ (vc-do-command buffer 'async "git" name "rev-list" "--pretty" "HEAD" "--")))
-(defun vc-git-diff (file &optional rev1 rev2)
- (let ((name (file-relative-name file)))
+(defun vc-git-diff (file &optional rev1 rev2 buffer)
+ (let ((name (file-relative-name file))
+ (buf (or buffer "*vc-diff*")))
(if (and rev1 rev2)
- (vc-do-command "*vc-diff*" 0 "git" name "diff-tree" "-p" rev1 rev2 "--")
- (vc-do-command "*vc-diff*" 0 "git" name "diff-index" "-p" (or rev1 "HEAD") "--"))
+ (vc-do-command buf 0 "git" name "diff-tree" "-p" rev1 rev2 "--")
+ (vc-do-command buf 0 "git" name "diff-index" "-p" (or rev1 "HEAD") "--"))
; git-diff-index doesn't set exit status like diff does
(if (vc-git-workfile-unchanged-p file) 0 1)))