sshaw / git-link

Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location
394 stars 73 forks source link

Support for Linking to `git blame` Page & Linking to Documentation Files like Org and Markdown Files on Bitbucket #83

Closed djgoku closed 3 days ago

djgoku commented 3 years ago

Whenever using git-link on these files for GitHub/Bitbucket I usually have to use the blame/annotate url to link vs GitLab does the what I would expect.

https://gitlab.com/protesilaos/modus-themes/-/blob/main/README.md#L1-13 vs https://gitlab.com/protesilaos/modus-themes/-/blob/main/README.md

vs

https://github.com/sshaw/git-link/blob/master/README.md#L6-L11 (does nothing, other than open the link) vs https://github.com/sshaw/git-link/blame/master/README.md#L6-L11 links to and highlights lines 6-11.

vs

https://bitbucket.org/tutorials/markdowndemo/src/master/README.md?at=master#README.md-1:11 (does nothing, other than open the link) vs https://bitbucket.org/tutorials/markdowndemo/annotate/master/README.md?at=master#README.md-1:11

If I was wanting to add this feature where would be the best place to add this?

sshaw commented 3 years ago

Hi,

It sounds like there are a few things here. First bugs, for Org/Markdown files:

Second, a new feature:

Is that correct?

djgoku commented 3 years ago
  • GitHub: linking to line numbers in does not work. This appears to be a GitHub bug because if you do it by hand the URL is the same.
  • Bitbucket: no longer support linking to line numbers (brilliant Atlassian) unless going through the blame page

Yes, if I git-link on either an org-mode file or a Markdown file for GitHub/Bitbucket when opening the link it'll just open the file. If I use blame/annotate I can link to specific line numbers. This is a GitHub/Bitbucket specific issue.

  • Linking to the blame page for a file which you're saying can be (or you want to be) a solution for the 2 items above

Yes I want to write something to handle the above situations so I don't have to manually create the links.

sshaw commented 3 days ago

Fixed by #128

djgoku commented 3 days ago

@sshaw did you mean to re-open this?

sshaw commented 3 days ago

No. Strange.