From ee57ec6935c2ab71751daca886d74a5ca823fbcb Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 24 Aug 2021 18:24:27 -0700 Subject: emacs: get rid of mapping for sourcegraph Since the hostname from the git remote is appended to 'sourcegraph.twitter.biz', we can get rid of the mapping and just build the URL using `format`. This simplifies even more the solution. --- emacs/custom/fcuny-git.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'emacs') diff --git a/emacs/custom/fcuny-git.el b/emacs/custom/fcuny-git.el index 97a9cfa..4c6409a 100644 --- a/emacs/custom/fcuny-git.el +++ b/emacs/custom/fcuny-git.el @@ -89,12 +89,8 @@ :bind (("C-c g l" . git-link) ("C-c g a" . git-link-commit)) :config - (defvar fcuny/map-git-remote-to-sg - '(("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))) + (format "sourcegraph.twitter.biz/%s" hostname)) (defun fcuny/git-link-work-sourcegraph (hostname dirname filename _branch commit start end) (let ((sg-base-url (fcuny/get-sg-remote-from-hostname hostname))) -- cgit 1.4.1