sshaw / git-link

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

Git link from buffer created by `log-view-find-revision` goes to page not found on Github #123

Open jjnilton opened 4 months ago

jjnilton commented 4 months ago

The README states that git-link works with VC revisions, but a URL generated from a buffer created by log-view-find-revision returns 404 error on Github.

Reproduce steps:

  1. C-x v l in a git tracked file/buffer
  2. f on a commit
  3. A buffer named FileName.php.~adcfbddbc26784c5f6dbd9e1860e4afee58f013a~ is generated
  4. M-x git-link

Result:

https://github.com/[org]/[repo]/blob/bugfix%2Fab%2318867/src/[redacted]/[redacted]/[redacted]/FileName.php.~adcfbddbc26784c5f6dbd9e1860e4afee58f013a~#L1

Visiting the generate URL goes to a 404 - page not found on Github.

Expected:

https://github.com/[org]/[repo]/blob/af469d650ba1a823f9a8b390399d7f8dd9956e76/src/[redacted]/[redacted]/[redacted]/FileName.php#L1

A working URL like the ones from git-timemachine and magit generated buffers.

System version: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2023-02-23, modified by Debian Description: Debian GNU/Linux 11 (bullseye)