Bugs out if you have added a remote that's not github/bitbucket/gitlab
(insert-issue--get-remote-url)
for one of my repos returns
"unhammer.org:/home/unhammer/git/foo.git
"
which means whenever I type "fixes #" I get
s-contains?: Wrong type argument: stringp, nil
from insert-issue--get-server
.
That function could be fixed to
(defun insert-issue--get-server ()
"Check the git host.
From git@server.com:group/project.git or https://server.com/group/project, get server.com"
(let* ((url (insert-issue--get-remote-url)) ;; git@gitlab.com:emacs-stuff/project-name.git
;; Dealing with different protocols: git@foo:bar or https://foo/bar
;; Could definitely be proper.
(server-group-name (if (s-contains? "@" url)
(-first-item (cdr (s-split "@" url)))
(if (s-contains? "://" url)
(-first-item (cdr (s-split "://" url)))))) ;; gitlab.com:emacs-stuff/project-name.git
(server (when server-group-name
(if (s-contains? ":" server-group-name)
(car (s-split ":" server-group-name))
(if (s-contains? "/" server-group-name)
(car (s-split "/" server-group-name)))))))
server))
but git-commit-insert-issue-get-issues-github-or-gitlab-or-bitbucket-format
also needs to be fixed to avoid treating anything non-github/bitbucket as gitlab.
(On a related note, that was just one of my remotes – it'd make sense to go through the list and pick the first one that's one of github/bitbucket/gitlab instead of just picking the first.)