aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2009-09-15 00:11:51 +0000
committerDan Nicolaescu2009-09-15 00:11:51 +0000
commit60308853c3ff3563d9e5855b37824b0aa3555eed (patch)
treedb38f7b4e463ff0dc283c78edab90c89d8d267e1
parent9cd39affaa9df0533621bc6714247b92d77f2e9e (diff)
downloademacs-60308853c3ff3563d9e5855b37824b0aa3555eed.tar.gz
emacs-60308853c3ff3563d9e5855b37824b0aa3555eed.zip
(vc-git-dir-extra-headers): Show the remote location.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc-git.el34
2 files changed, 32 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 685c0cde955..5884e69dd69 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12009-09-15 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * vc-git.el (vc-git-dir-extra-headers): Show the remote location.
4
12009-09-14 Dan Nicolaescu <dann@ics.uci.edu> 52009-09-14 Dan Nicolaescu <dann@ics.uci.edu>
2 6
3 * bindings.el (mode-line-mode-menu): Add purecopy calls for :help. 7 * bindings.el (mode-line-mode-menu): Add purecopy calls for :help.
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index 5230d54216e..63cefb572c9 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -403,16 +403,38 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
403 (let ((str (with-output-to-string 403 (let ((str (with-output-to-string
404 (with-current-buffer standard-output 404 (with-current-buffer standard-output
405 (vc-git--out-ok "symbolic-ref" "HEAD")))) 405 (vc-git--out-ok "symbolic-ref" "HEAD"))))
406 (stash (vc-git-stash-list))) 406 (stash (vc-git-stash-list))
407 branch remote remote-url)
408 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
409 (progn
410 (setq branch (match-string 2 str))
411 (message "branch (%s)" branch)
412 (setq remote
413 (with-output-to-string
414 (with-current-buffer standard-output
415 (vc-git--out-ok "config" (concat "branch." branch ".remote")))))
416 (when (string-match "\\([^\n]+\\)" remote)
417 (setq remote (match-string 1 remote)))
418 (when remote
419 (setq remote-url
420 (with-output-to-string
421 (with-current-buffer standard-output
422 (vc-git--out-ok "config" (concat "remote." remote ".url"))))))
423 (when (string-match "\\([^\n]+\\)" remote-url)
424 (setq remote-url (match-string 1 remote-url))))
425 "not (detached HEAD)")
407 ;; FIXME: maybe use a different face when nothing is stashed. 426 ;; FIXME: maybe use a different face when nothing is stashed.
408 (when (string= stash "") (setq stash "Nothing stashed")) 427 (when (string= stash "") (setq stash "Nothing stashed"))
409 (concat 428 (concat
410 (propertize "Branch : " 'face 'font-lock-type-face) 429 (propertize "Branch : " 'face 'font-lock-type-face)
411 (propertize 430 (propertize branch
412 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str) 431 'face 'font-lock-variable-name-face)
413 (match-string 2 str) 432 (when remote
414 "not (detached HEAD)") 433 (concat
415 'face 'font-lock-variable-name-face) 434 "\n"
435 (propertize "Remote : " 'face 'font-lock-type-face)
436 (propertize remote-url
437 'face 'font-lock-variable-name-face)))
416 "\n" 438 "\n"
417 (propertize "Stash : " 'face 'font-lock-type-face) 439 (propertize "Stash : " 'face 'font-lock-type-face)
418 (propertize 440 (propertize