+2008-03-28 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * vc.el: Add new backend function 'status-extra-headers.
+ (vc-default-status-extra-headers): New function.
+ (vc-status-headers): Call 'status-extra-headers. Add colors.
+
+ * vc-git.el (vc-git-status-extra-headers): New function.
+
2008-03-28 Glenn Morris <rgm@gnu.org>
* calendar/cal-menu.el (cal-menu-holidays-menu)
`(vc-git-after-dir-status-stage1 (quote ,update-function) ,status-buffer)))
(current-buffer)))
+(defun vc-git-status-extra-headers (dir)
+ (let ((str (with-output-to-string
+ (with-current-buffer standard-output
+ (vc-git--out-ok "symbolic-ref" "HEAD")))))
+ (concat
+ (propertize "Branch : " 'face 'font-lock-type-face)
+ (propertize
+ (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
+ (match-string 2 str)
+ "not (detached HEAD)")
+ 'face 'font-lock-variable-name-face))))
+
;;; STATE-CHANGING FUNCTIONS
(defun vc-git-create-repo ()
;; change.
;; This is a replacement for dir-state.
;;
+;; - status-extra-headers (dir)
+;;
+;; Return a string that will be added to the *vc-status* buffer header.
+;;
;; * working-revision (file)
;;
;; Return the working revision of FILE. This is the revision fetched
(defvar vc-status nil)
+(defun vc-default-status-extra-headers (backend dir)
+ "Extra : Add backend specific headers here")
+
(defun vc-status-headers (backend dir)
(concat
- (format "VC backend : %s\n" backend)
- "Repository : The repository goes here\n"
- (format "Working dir: %s\n" dir)))
+ (propertize "VC backend : " 'face 'font-lock-type-face)
+ (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face)
+ (propertize "Working dir: " 'face 'font-lock-type-face)
+ (propertize (format "%s\n" dir) 'face 'font-lock-variable-name-face)
+ (vc-call-backend backend 'status-extra-headers dir)
+ "\n"))
(defun vc-status-printer (fileentry)
"Pretty print FILEENTRY."