f-person / git-blame.nvim

Git Blame plugin for Neovim written in Lua
GNU General Public License v3.0
909 stars 42 forks source link

feat: Normalize remote url to use with GitBlameOpenCommitURL #44

Closed geralfonso closed 2 years ago

geralfonso commented 2 years ago

Hi,

I like a lot GitBlameOpenCommitURL command, but it was not working for me because some remote urls have the SSH URL version, like:

git@github.com:someorg/some-repo.git
ssh://git@gitlab-master.MyCompany.com:12051/Me/PROJECT1.git
git@gitlab-master.MyCompany.com:Me/PROJECT1.git
git@bitbucket.org:Me/PROJECT2.git

and also because of the .git word at the end, like: https://github.com/f-person/git-blame.nvim.git

I figured it would be helpful if we normalize the remote url to support all formats

f-person commented 2 years ago

This is very cool! Thank you a lot!

bear24rw commented 1 year ago

I think there might be an edgecase that's not handled? I am getting un-normalized urls:

gitlab@gitlab.foo.company.com:org/project/repo.git/commit/197a00bafd0290223492f24ea1b8db81fdfa93ea
f-person commented 1 year ago

@bear24rw can you please share the output of git remote get-url origin (feel free to replace the private stuff with foo/bar/etc)

bear24rw commented 1 year ago

@bear24rw can you please share the output of git remote get-url origin (feel free to replace the private stuff with foo/bar/etc)

gitlab@gitlab.org.company.com:group/subproject/repo.git