Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local commits result in invalid link #46

Open
bogdan opened this issue Feb 25, 2021 · 2 comments
Open

Local commits result in invalid link #46

bogdan opened this issue Feb 25, 2021 · 2 comments

Comments

@bogdan
Copy link

bogdan commented Feb 25, 2021

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
Copy link

rodnaph commented Sep 17, 2021

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
Copy link

erikw commented Nov 17, 2022

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:

  • when local commit: use last pushed commit that exist on the remote as well
  • when local commit: default to the repo's default branch (main or master for example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants