Skip to content

Commit

Permalink
Fix print-log and diff compatibility with recent vc versions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ville Skytt,Ad(B authored and Junio C Hamano committed Jul 5, 2006
1 parent 4bbf599 commit b5dd9d2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions contrib/emacs/vc-git.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit b5dd9d2

Please sign in to comment.