(unless (and pos (log-view-inside-comment-p pos))
(error "Broken markup in `log-view-toggle-entry-display'"))
(delete-region pos
- (next-single-property-change pos 'log-view-comment))
+ (or
+ (next-single-property-change pos 'log-view-comment)
+ (point-max)))
(put-text-property beg (1+ beg) 'log-view-entry-expanded nil)
(if (< opoint pos)
(goto-char opoint)))
((looking-back "Show 2X entries Show unlimited entries"
(line-beginning-position))
(setq looping nil)
- (forward-line -1))))))
+ (forward-line -1))
+ ;; There are no buttons if we've turned on unlimited entries.
+ ((eobp)
+ (setq looping nil))))))
(defun log-view-end-of-defun (&optional arg)
"Move forward to the next Log View entry.
(setq prev-rev
(vc-call-backend vc-annotate-backend 'previous-revision
(if filediff fname nil) rev))
- (if (not prev-rev)
- (message "Cannot diff from any revision prior to %s" rev)
- (vc-diff-internal
- t
- ;; The value passed here should follow what
- ;; `vc-deduce-fileset' returns.
- (list vc-annotate-backend
- (if filediff
- (list fname)
- nil))
- prev-rev rev))))))
+ (vc-diff-internal
+ t
+ ;; The value passed here should follow what
+ ;; `vc-deduce-fileset' returns.
+ (list vc-annotate-backend
+ (if filediff
+ (list fname)
+ nil))
+ prev-rev rev)))))
(defun vc-annotate-show-diff-revision-at-line ()
"Visit the diff of the revision at line from its previous revision."
(defun vc-git-expanded-log-entry (revision)
(with-temp-buffer
- (apply 'vc-git-command t nil nil (list "log" revision "-1"))
+ (apply 'vc-git-command t nil nil (list "log" revision "-1" "--"))
(goto-char (point-min))
(unless (eobp)
;; Indent the expanded log entry.
(indent-region (point-min) (point-max) 2)
(buffer-string))))
-
(defun vc-git-region-history (file buffer lfrom lto)
(vc-git-command buffer 'async nil "log" "-p" ;"--follow" ;FIXME: not supported?
(format "-L%d,%d:%s" lfrom lto (file-relative-name file))))
(defun vc-git-diff (files &optional rev1 rev2 buffer async)
"Get a difference report using Git between two revisions of FILES."
- (let (process-file-side-effects)
+ (let (process-file-side-effects
+ (command "diff-tree"))
+ (if rev2
+ ;; Diffing against the empty tree.
+ (unless rev1 (setq rev1 "4b825dc642cb6eb9a060e54bf8d69288fbee4904"))
+ (setq command "diff-index")
+ (unless rev1 (setq rev1 "HEAD")))
(if vc-git-diff-switches
(apply #'vc-git-command (or buffer "*vc-diff*")
(if async 'async 1)
files
- (if (and rev1 rev2) "diff-tree" "diff-index")
+ command
"--exit-code"
(append (vc-switches 'git 'diff)
(list "-p" (or rev1 "HEAD") rev2 "--")))
(concat "diff "
(mapconcat 'identity
(vc-switches nil 'diff) " "))
- (or rev1 "HEAD") rev2 "--"))))
+ rev1 rev2 "--"))))
(defun vc-git-revision-table (_files)
;; What about `files'?!? --Stef
(declare-function vc-annotate-convert-time "vc-annotate" (&optional time))
(defun vc-git-annotate-time ()
- (and (re-search-forward "^[0-9a-f]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t)
+ (and (re-search-forward "^[0-9a-f^]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t)
(vc-annotate-convert-time
(apply #'encode-time (mapcar (lambda (match)
(if (match-beginning match)
(defun vc-git-annotate-extract-revision-at-line ()
(save-excursion
(beginning-of-line)
- (when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?")
+ (when (looking-at "\\^?\\([0-9a-f]+\\) \\(\\([^(]+\\) \\)?")
(let ((revision (match-string-no-properties 1)))
(if (match-beginning 2)
(let ((fname (match-string-no-properties 3)))
;; BUFFER is nil. If ASYNC is non-nil, run asynchronously. If REV1
;; and REV2 are non-nil, report differences from REV1 to REV2. If
;; REV1 is nil, use the working revision (as found in the
-;; repository) as the older revision; if REV2 is nil, use the
+;; repository) as the older revision if REV2 is nil as well;
+;; otherwise, diff against an empty tree. If REV2 is nil, use the
;; current working-copy contents as the newer revision. This
;; function should pass the value of (vc-switches BACKEND 'diff) to
;; the backend command. It should return a status of either 0 (no