Accessing permalinks

Darragh Bailey daragh.bailey at gmail.com
Wed Jun 15 15:32:20 CEST 2016


Hi,


I've been using some services that are backed by cgit and in accessing them
I'm finding it awkward to get permalinks to lines of code.

For example:
Using codesearch.openstack.org (uses etsy/hound project from github) and
searching for the line of code:
tconfigs.set\('class', 'java.util.Collections\$EmptyList'\)

Following the first result returned brings me to:
http://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/jenkins_jobs/modules/builders.py#n549

While the default link available is convenient for immediate discussions, I
usually prefer to have a permalink for email and issue tracker usage.

Right now, I can click 'log' from the top of the page to go to:
http://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/log/jenkins_jobs/modules/builders.py

Then click on the commit message entry to go to:
http://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/commit/jenkins_jobs/modules/builders.py?id=6e4b760655a7128600e9541875380f07793ccbb0

Then lastly click on the filename towards the bottom of the commit entry
page to get to:
http://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/jenkins_jobs/modules/builders.py?id=6e4b760655a7128600e9541875380f07793ccbb0

Then any of the lines to line numbers, will contain the sha1 meaning that
they should be permanent (to a degree, I know someone could remove the
commit from the history if needed, but good enough), and I can use the
following link to reference the line I was interested in:
http://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/jenkins_jobs/modules/builders.py?id=6e4b760655a7128600e9541875380f07793ccbb0#n549

This seems a bit unnecessary. I'm wondering if there is a way for cgit to
easily get from the first page that I opened from codesearch.openstack.org,
to the permalink of the same file and line number at the point in time in
the repository that I arrived at in a single step? Is there a key like
github's 'press "y"', or an extra link that can be activated, or is this an
enhancement?

Alternatively is this something that should be done by etsy/hound (software
behind codesearch.openstack.org) in how it integrates to be able to provide
links to the file using the sha1 instead of against the branch name?


-- 
Darragh Bailey
"Nothing is foolproof to a sufficiently talented fool"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160615/d3c3edb2/attachment.html>


More information about the CGit mailing list