sourcegraph / sourcegraph-jetbrains

Sourcegraph for JetBrains IDEs (IntelliJ)

Home Page:https://sourcegraph.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to configure the remote?

ddnexus opened this issue · comments

I have a local NAS remote and the github (origin) remote, and I always get a non-working link to the NAS repository instead of a link of the repository on github.

I get this:
https://sourcegraph.com/nas.local/volume1/repos/pagy@3.0/-/blob/lib/pagy/extras/pagy_search.rb#L10:13

Instead of this:
https://sourcegraph.com/github.com/ddnexus/pagy@3.0/-/blob/lib/pagy/extras/pagy_search.rb#L10:13

Even if the local branch tracks the github remote and not the NAS remote. How can I point it to the remote github repo?

Discussed this with @ddnexus via a support channel. The Sourcegraph JetBrains extension uses the first remote returned by git remote (see https://sourcegraph.com/github.com/sourcegraph/sourcegraph-jetbrains@master/-/blob/src/Util.java#L22:26). Given this command returns a list in alphabetical order, it can result in some weirdness.

A better heuristic, or some way of specifying the remote per repo, would be ideal.

Apologies for the massive delay on this being fixed. We have changed the default to use the origin remote, and you can now configure via Git a sourcegraph remote if the origin one is not suitable. e.g.:

git remote add sourcegraph https://github.com/my/repo

This update (v1.1.2) will be released in ~2 business days.