diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2008-03-28 03:50:26 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2008-03-28 03:50:26 +0000 |
commit | 15c5c97086ad7d7e3a40ea15ff3acf947de1e0a2 (patch) | |
tree | d1cca4eaf88f9c8cc901203ebee7457feabfec0c /lisp/vc-git.el | |
parent | 1baf9da41e379f50a27d12821e03b132144f09c3 (diff) | |
download | emacs-15c5c97086ad7d7e3a40ea15ff3acf947de1e0a2.tar.gz |
* 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.
Diffstat (limited to 'lisp/vc-git.el')
-rw-r--r-- | lisp/vc-git.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 9706afed983..e4150f558ae 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el @@ -264,6 +264,18 @@ `(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 () |