Mercurial > emacs
comparison lisp/vc-git.el @ 93333:53eee5c271f4
* 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.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Fri, 28 Mar 2008 03:50:26 +0000 |
parents | 231f72336aed |
children | 8e46096e0cb3 |
comparison
equal
deleted
inserted
replaced
93332:bf0cafc88be5 | 93333:53eee5c271f4 |
---|---|
262 (vc-git-command (current-buffer) 'async nil "diff-index" "-z" "HEAD") | 262 (vc-git-command (current-buffer) 'async nil "diff-index" "-z" "HEAD") |
263 (vc-exec-after | 263 (vc-exec-after |
264 `(vc-git-after-dir-status-stage1 (quote ,update-function) ,status-buffer))) | 264 `(vc-git-after-dir-status-stage1 (quote ,update-function) ,status-buffer))) |
265 (current-buffer))) | 265 (current-buffer))) |
266 | 266 |
267 (defun vc-git-status-extra-headers (dir) | |
268 (let ((str (with-output-to-string | |
269 (with-current-buffer standard-output | |
270 (vc-git--out-ok "symbolic-ref" "HEAD"))))) | |
271 (concat | |
272 (propertize "Branch : " 'face 'font-lock-type-face) | |
273 (propertize | |
274 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str) | |
275 (match-string 2 str) | |
276 "not (detached HEAD)") | |
277 'face 'font-lock-variable-name-face)))) | |
278 | |
267 ;;; STATE-CHANGING FUNCTIONS | 279 ;;; STATE-CHANGING FUNCTIONS |
268 | 280 |
269 (defun vc-git-create-repo () | 281 (defun vc-git-create-repo () |
270 "Create a new Git repository." | 282 "Create a new Git repository." |
271 (vc-git-command nil 0 nil "init")) | 283 (vc-git-command nil 0 nil "init")) |