ruanyl / vim-gh-line

vim plugin that open the link of current line on github
MIT License
408 stars 37 forks source link

Local commits result in invalid link #46

Open bogdan opened 3 years ago

bogdan commented 3 years ago

If there are local commit in a branch, the github link is generated with those. I think it should take last pushed commit in current branch instead.

rodnaph commented 2 years ago

I agree, this is frustrating when working on an un-pushed branch and you need to share a link to something.

It should be nice to have the option to link to the default branch, <leader>ghm or something...

erikw commented 1 year ago

I very much agree. I use this plugin every day and it's really great!

However I will almost always have local commits at the time when I need to quickly share an URL, meaning that I need to manually change the opended URL by replacing the commit hash with e.g. main or master, then in the GitHub file viewe copy on a line nubmer and select "Copy permalink", to get the peralink to a commit that exist on GitHub.

I could imagine solutions be one of the above mentioned: