Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{git-commit} for Source Links #168

Open
UweHubert opened this issue Jan 12, 2018 · 1 comment
Open

{git-commit} for Source Links #168

UweHubert opened this issue Jan 12, 2018 · 1 comment

Comments

@UweHubert
Copy link

UweHubert commented Jan 12, 2018

Problem
We can not link to the exact code of a SNAPSHOT using the :source-uri.

Either we are forced to use the master branch, which is not desirable, as this renders links in old documentation useless.
Or we would wind up with the snapshot version in the source link:

http://gerrit.mydomain.de/gitlist/myproject.git/blob/0.6.0-SNAPSHOT/src/de/mydomain/foo/bar.clj#L23

That would force us to use branches for this sole purpose, leaving us with the same problem of documentation links pointing to changing source code.

Proposed solution
Allowing a placeholder ({git-commit}) for :source-uri that is replaced with the Git commit id.

:codox
{:source-uri "http://gerrit.mydomain.de/gitlist/myproject.git/blob/{git-commit}/{filepath}#L{line}"}

Which would result in:

http://gerrit.mydomain.de/gitlist/myproject.git/blob/17073c0db441f5550a6cdbd1e5d2143ae6f5b576/src/de/mydomain/foo/bar.clj#L23

If you are generally interested in this solution we can supply a patch.

@weavejester
Copy link
Owner

I think sounds reasonable.

UweHubert pushed a commit to UweHubert/codox that referenced this issue Jan 16, 2018
In source URIs the key '{git-commit}' is replaced with the Git commit
id of the repository.

See weavejester#168
UweHubert pushed a commit to UweHubert/codox that referenced this issue Jan 29, 2018
In source URIs the key '{git-commit}' is replaced with the Git commit
id of the repository.

See weavejester#168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants