@matheusbsbs / matheus-bagliano / commits / b5dd9d2027
Fork 0

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 <scop@xemacs.org>

Ville Skytt,Ad(B committed Jul 5, 2006 at 01:35 UTC b5dd9d2027c1bd5758033c7baf6d087752b0263d
1 file changed +7 -6
contrib/emacs/vc-git.el
+7 -6
@@ -95,16 +95,17 @@
95 "Register FILE into the git version-control system."
96 (vc-git--run-command file "update-index" "--add" "--"))
97
98 -(defun vc-git-print-log (file)
98 +(defun vc-git-print-log (file &optional buffer)
99 (let ((name (file-relative-name file))
100 (coding-system-for-read git-commits-coding-system))
101 - (vc-do-command nil 'async "git" name "rev-list" "--pretty" "HEAD" "--")))
101 + (vc-do-command buffer 'async "git" name "rev-list" "--pretty" "HEAD" "--")))
102
103 -(defun vc-git-diff (file &optional rev1 rev2)
104 - (let ((name (file-relative-name file)))
103 +(defun vc-git-diff (file &optional rev1 rev2 buffer)
104 + (let ((name (file-relative-name file))
105 + (buf (or buffer "*vc-diff*")))
106 (if (and rev1 rev2)
106 - (vc-do-command "*vc-diff*" 0 "git" name "diff-tree" "-p" rev1 rev2 "--")
107 - (vc-do-command "*vc-diff*" 0 "git" name "diff-index" "-p" (or rev1 "HEAD") "--"))
107 + (vc-do-command buf 0 "git" name "diff-tree" "-p" rev1 rev2 "--")
108 + (vc-do-command buf 0 "git" name "diff-index" "-p" (or rev1 "HEAD") "--"))
109 ; git-diff-index doesn't set exit status like diff does
110 (if (vc-git-workfile-unchanged-p file) 0 1)))
111