Feature request: easy way to get a permalink

Trevor Gross tg at trevorgross.com
Sun Jun 21 05:25:24 UTC 2026


Hello all,

It's pretty useful to be able to share a link to a source view that
doesn't get outdated if the source updates. cgit supports these links
but it requires a few steps to create them. Would it be possible to add
a button that makes this easier?

For example, when visiting this URL:

     https://git.zx2c4.com/cgit/tree/README#n4

There could be a `permalink` button in the `path: root/README` bar (or
perhaps next to `(plain) (blame)`) that replaces the URL with:

     
https://git.zx2c4.com/cgit/tree/README?id=044821677c774cd24f25f1818ea51d09cc64b006#n4

04482167 being the most recent commit. This should work for directories
in the tree view as well, though the `path:` bar is not visible at root.

GitHub and GitLab have something similar under the triple dots menu,
which also copies the link to the clipboard.

Kind regards,
Trevor


More information about the CGit mailing list