forge icon indicating copy to clipboard operation
forge copied to clipboard

Easily browse or kill permalink to file with line number

Open amake opened this issue 3 years ago • 2 comments

I often find myself wanting to send a GitHub permalink URL to someone. Often I want to point out a particular line or range of lines in a particular file at a particular revision, and to do this I have to go to GitHub, find the file (cumbersome), maybe find the exact commit (also cumbersome), select the range of lines, and choose "Copy Permalink" from the little menu thing.

It seems to me that Magit+Forge together should have enough information to generate the permalink from within Emacs. I am imagining something like forge-browse-dwim or forge-copy-url-at-point-as-kill being invocable on any line of a git-managed buffer. When a range is present the link would point to the full range of lines, like:

https://github.com/magit/forge/blob/551e51511e25505d14e05699a1707fd57e394a9a/Makefile#L8-L20

amake avatar May 26 '21 04:05 amake

I use git-link for that purposes.

pkryger avatar May 26 '21 05:05 pkryger

Thanks! I'll check that out.

If this functionality is better left to other packages like git-link then feel free to close this ticket.

amake avatar May 26 '21 05:05 amake

Closing in favor of #91.

tarsius avatar Dec 09 '23 23:12 tarsius