]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-git-dir-extra-headers): Show the remote location.
authorDan Nicolaescu <dann@ics.uci.edu>
Tue, 15 Sep 2009 00:11:51 +0000 (00:11 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Tue, 15 Sep 2009 00:11:51 +0000 (00:11 +0000)
lisp/ChangeLog
lisp/vc-git.el

index 685c0cde955c5fc6b0ad9f9cdef65bd0cdeacc2b..5884e69dd69b8451aabeed105f050626e9bafc62 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-15  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el (vc-git-dir-extra-headers): Show the remote location.
+
 2009-09-14  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * bindings.el (mode-line-mode-menu): Add purecopy calls for :help.
index 5230d54216e121f0940ce48945a707341c0afe72..63cefb572c957a39fc2438f95a25b8016176d194 100644 (file)
@@ -403,16 +403,38 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   (let ((str (with-output-to-string
                (with-current-buffer standard-output
                  (vc-git--out-ok "symbolic-ref" "HEAD"))))
-       (stash (vc-git-stash-list)))
+       (stash (vc-git-stash-list))
+       branch remote remote-url)
+    (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
+       (progn
+         (setq branch (match-string 2 str))
+         (message "branch (%s)" branch)
+         (setq remote
+               (with-output-to-string
+                 (with-current-buffer standard-output
+                   (vc-git--out-ok "config" (concat "branch." branch ".remote")))))
+         (when (string-match "\\([^\n]+\\)" remote)
+           (setq remote (match-string 1 remote)))
+         (when remote
+           (setq remote-url
+                 (with-output-to-string
+                   (with-current-buffer standard-output
+                     (vc-git--out-ok "config" (concat "remote." remote ".url"))))))
+         (when (string-match "\\([^\n]+\\)" remote-url)
+           (setq remote-url (match-string 1 remote-url))))
+      "not (detached HEAD)")
     ;; FIXME: maybe use a different face when nothing is stashed.
     (when (string= stash "") (setq stash "Nothing stashed"))
     (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)
+     (propertize branch
+                'face 'font-lock-variable-name-face)
+     (when remote
+       (concat
+       "\n"
+       (propertize "Remote     : " 'face 'font-lock-type-face)
+       (propertize remote-url
+                   'face 'font-lock-variable-name-face)))
      "\n"
      (propertize "Stash      : " 'face 'font-lock-type-face)
      (propertize