if git-link--remote fails to find a remote, it tries to fallback to origin.
i have repos with no origin but that do have remotes. in such cases doesn't it make sense to fallback to an actually existing remote, even just the first result of git-link--remotes, rather than a hardcoded option?
e.g.
(defun git-link--remote ()
(let* ((branch (git-link--current-branch))
(remote (or (git-link--get-config "git-link.remote")
git-link-default-remote
(git-link--branch-remote branch)
(car (git-link--remotes))))) ;; Fallback to first remote if all else fails
;; Git defaults to "." if the branch has no remote.
;; If the branch has no remote we try master's, which may be set.
(if (or (null remote)
(and (string= remote ".")
(not (string= branch "master"))))
(setq remote (git-link--branch-remote "master")))
(if (or (null remote) (string= remote "."))
"origin"
remote)))
i just started using git-link, so not sure if this would make sense in the library/for other users.
if
git-link--remotefails to find a remote, it tries to fallback toorigin.i have repos with no
originbut that do have remotes. in such cases doesn't it make sense to fallback to an actually existing remote, even just the first result ofgit-link--remotes, rather than a hardcoded option?e.g.
i just started using git-link, so not sure if this would make sense in the library/for other users.