(if (not rev-at-line)
(message "Cannot extract revision number from the current line")
(setq prev-rev
- (vc-call-backend vc-annotate-backend 'previous-revision
- fname rev))
+ (let ((vc-use-short-revision vc-annotate-use-short-revision))
+ (vc-call-backend vc-annotate-backend 'previous-revision
+ fname rev)))
(if (not prev-rev)
(message "No previous revisions")
(vc-annotate-warp-revision prev-rev fname))))))
(if (not rev-at-line)
(message "Cannot extract revision number from the current line")
(setq prev-rev
- (vc-call-backend vc-annotate-backend 'previous-revision
- (if filediff fname nil) rev))
+ (let ((vc-use-short-revision vc-annotate-use-short-revision))
+ (vc-call-backend vc-annotate-backend 'previous-revision
+ (if filediff fname nil) rev)))
(vc-diff-internal
vc-allow-async-diff
;; The value passed here should follow what
(cond
((and (integerp revspec) (> revspec 0))
(setq newrev vc-buffer-revision)
- (while (and (> revspec 0) newrev)
- (setq newrev (vc-call-backend vc-annotate-backend 'next-revision
- (or file
- (caadr vc-buffer-overriding-fileset))
- newrev))
- (setq revspec (1- revspec)))
+ (let ((vc-use-short-revision vc-annotate-use-short-revision))
+ (while (and (> revspec 0) newrev)
+ (setq newrev
+ (vc-call-backend vc-annotate-backend 'next-revision
+ (or file
+ (caadr vc-buffer-overriding-fileset))
+ newrev))
+ (setq revspec (1- revspec))))
(unless newrev
(message "Cannot increment %d revisions from revision %s"
revspeccopy vc-buffer-revision)))
((and (integerp revspec) (< revspec 0))
(setq newrev vc-buffer-revision)
- (while (and (< revspec 0) newrev)
- (setq newrev (vc-call-backend vc-annotate-backend 'previous-revision
- (or file
- (caadr vc-buffer-overriding-fileset))
- newrev))
- (setq revspec (1+ revspec)))
+ (let ((vc-use-short-revision vc-annotate-use-short-revision))
+ (while (and (< revspec 0) newrev)
+ (setq newrev
+ (vc-call-backend vc-annotate-backend 'previous-revision
+ (or file
+ (caadr vc-buffer-overriding-fileset))
+ newrev))
+ (setq revspec (1+ revspec))))
(unless newrev
(message "Cannot decrement %d revisions from revision %s"
(- 0 revspeccopy) vc-buffer-revision)))
;;; MISCELLANEOUS
+(defsubst vc-git--maybe-abbrev ()
+ (if vc-use-short-revision "--abbrev-commit" "--no-abbrev-commit"))
+
(defun vc-git-previous-revision (file rev)
"Git-specific version of `vc-previous-revision'."
(if file
(let* ((fname (file-relative-name file))
(prev-rev (with-temp-buffer
(and
- (vc-git--out-ok "rev-list" "-2" rev "--" fname)
+ (vc-git--out-ok "rev-list"
+ (vc-git--maybe-abbrev)
+ "-2" rev "--" fname)
(goto-char (point-max))
(bolp)
(zerop (forward-line -1))
(current-rev
(with-temp-buffer
(and
- (vc-git--out-ok "rev-list" "-1" rev "--" file)
+ (vc-git--out-ok "rev-list"
+ (vc-git--maybe-abbrev)
+ "-1" rev "--" file)
(goto-char (point-max))
(bolp)
(zerop (forward-line -1))
(and current-rev
(with-temp-buffer
(and
- (vc-git--out-ok "rev-list" "HEAD" "--" file)
+ (vc-git--out-ok "rev-list"
+ (vc-git--maybe-abbrev)
+ "HEAD" "--" file)
(goto-char (point-min))
(search-forward current-rev nil t)
(zerop (forward-line -1))