summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--emacs/custom/fcuny-git.el19
1 files changed, 5 insertions, 14 deletions
diff --git a/emacs/custom/fcuny-git.el b/emacs/custom/fcuny-git.el
index b85a9ea..97a9cfa 100644
--- a/emacs/custom/fcuny-git.el
+++ b/emacs/custom/fcuny-git.el
@@ -90,28 +90,19 @@
          ("C-c g a" . git-link-commit))
   :config
   (defvar fcuny/map-git-remote-to-sg
-    '(("git.twitter.biz" "sourcegraph.twitter.biz/twitter.biz")
+    '(("git.twitter.biz" "sourcegraph.twitter.biz/git.twitter.biz")
       ("gitpuppet.twitter.biz" "sourcegraph.twitter.biz/gitpuppet.twitter.biz")))
 
   (defun fcuny/get-sg-remote-from-hostname (hostname)
     (nth 1 (assoc hostname fcuny/map-git-remote-to-sg)))
 
   (defun fcuny/git-link-work-sourcegraph (hostname dirname filename _branch commit start end)
-    (let ((line-or-range (if end (format "%s-%s" start end) start))
-          (sg-base-url (fcuny/get-sg-remote-from-hostname hostname)))
-      (format "https://%s/%s@%s/-/blob/%s#L%s"
-              sg-base-url
-              dirname
-              commit
-              filename
-              line-or-range)))
+    (let ((sg-base-url (fcuny/get-sg-remote-from-hostname hostname)))
+      (git-link-sourcegraph sg-base-url dirname filename _branch commit start end)))
 
   (defun fcuny/git-link-commit-work-sourcegraph (hostname dirname commit)
-    (let (sg-base-url (fcuny/get-sg-remote-from-hostname hostname))
-      (format "https://%s/%s/-/commit/%s"
-              sg-base-url
-              dirname
-              commit)))
+    (let ((sg-base-url (fcuny/get-sg-remote-from-hostname hostname)))
+      (git-link-commit-sourcegraph sg-base-url dirname commit)))
 
   ;; for work related repositories, open them in our instance of sourcegraph
   (add-to-list 'git-link-remote-alist '("twitter" fcuny/git-link-work-sourcegraph))