jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.34k stars 1.83k forks source link

Unsupported git service (after renaming remote name) #3997

Open rabin-io opened 1 week ago

rabin-io commented 1 week ago

Describe the bug My setup used to work, so when I pressed o to open an MR with GitLab, but since I renamed the remote from origin to a different name, I get this error now.

To Reproduce

  1. Clone the repo
  2. Add 2nd remote (my fork)
  3. Rename origin to something else
  4. Try to create MR with o
services:
  'gitlab.exmaple.com': gitlab:gitlab.example.com

Expected behavior The MR url should open in my default browser

Version info:

❯ lazygit --version
commit=611fabde11d24d9acc71ee26077b9a1101f59f27, build date=2024-09-18T10:56:10Z, build source=binaryRelease, version=0.44.1, os=linux, arch=amd64, git version=2.47.0

❯ git --version
git version 2.47.0

Additional context When I run lazygit with -debug in the logs output, I still see lazygit try to use the origin remote name

...
Oct 18 03:36:37 |DEBU| time to get behind base branch values for all branches: 49.980564ms 
Oct 18 03:36:40 |DEBU| RunCommand command="git ls-remote --get-url origin"
Oct 18 03:36:40 |INFO| git ls-remote --get-url origin (2.410547ms) 
❯ git remote -v
contra      git@gitlab.example.com:contra/repo1.git (fetch)
contra      git@.gitlabexample.com:contra/repo1.git (push)
rabin-io    git@gitlab.example.com:rabin-io/repo1.git (fetch)
rabin-io    git@gitlab.example.com:rabin-io/repo1.git (push)
kevinrobayna commented 13 hours ago

I have the exact same issue and I'm also in the latest version, although in my case i still use origin as the name of remote.

$ git remote -v
origin  git@gitlab.foo-bar.com:Company/Team/Project.git (fetch)
origin  git@gitlab.foo-bar.com:Company/Team/Project.git (push)

$ lazygit --version
commit=, build date=, build source=homebrew, version=0.44.1, os=darwin, arch=arm64, git version=2.47.0
image