Closed peterbecich closed 1 year ago
Hi, thanks for the suggestion.
Does the Google example represent the path that one would get with a default JGit installation?
Also, if you can provide the following link structures for the follwing it would be helpful to explore adding this:
plain=1
for this. Thanks for the quick response
Does the Google example represent the path that one would get with a default JGit installation?
~I don't have any other examples of Gitile repositories outside of https://gerrit.googlesource.com/~ I don't think so, I have found another example with a different address scheme: https://github.com/sshaw/git-link/issues/100#issuecomment-1153092849 I don't know which, if either, is default.
I will guess that ~all~ some Gitile repositories take this form:
[Git http remote address]/+/[Git commit hash]/[file#line number]
For example repository https://gerrit.googlesource.com/bazlets/ with remote:
% git remote -v
origin https://gerrit.googlesource.com/bazlets (fetch)
origin https://gerrit.googlesource.com/bazlets (push)
Here is another collection of Gitile repositories: https://git.eclipse.org/r/plugins/gitiles/?format=HTML
One repository: https://git.eclipse.org/r/plugins/gitiles/www.eclipse.org/eef/
git clone ssh://git.eclipse.org:29418/www.eclipse.org/eef
It cannot be cloned due to an SSH access restriction.
One file in that repository: https://git.eclipse.org/r/plugins/gitiles/www.eclipse.org/eef/+/e9cbc436ca18671c1a5a6ae1fd40a9489259b08d/javadoc/2.1.1/org/eclipse/eef/provider/EEFRuleAuditDescriptionItemProvider.html
So I understand this could be complicated, because the address implied by the Git remote is:
https://git.eclipse.org/www.eclipse.org/eef/+/[commit]/[file name....]
but the actual address is
https://git.eclipse.org/r/plugins/gitiles/www.eclipse.org/eef/+/[commit]/[file name....]
Hi, thanks for all the information.
Given this, it seems that there is not standard config that one can use rather, they'd have to do a custom config based on their JGit-based service's defaults. Right?
Maybe an argument could be made to add something for gerrit.googlesource.com but then wouldn't that be Gerrit support? For that there was #81.
(Update: Looks like my change is limited to only googlesource.com
repos. I missed the fact that Gitiles repos can customize their URLs :facepalm: Sorry for the confusion!)
@sshaw @peterbecich Thanks for the investigation here! I believe I have implemented support for gitiles in my PR: https://github.com/sshaw/git-link/pull/105
I used googlesource.com
as an example (detailed in the PR), which hosts gitiles repos as well.
Unfortunately I was unable to test on the Eclipse repo above, because running git clone ssh://git.eclipse.org:29418/www.eclipse.org/eef
fails with a <$USER>@git.eclipse.org: Permission denied (publickey).
error.:
❯ git clone ssh://git.eclipse.org:29418/www.eclipse.org/eef eclipse-test
Cloning into 'eclipse-test'...
lucas@git.eclipse.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(note that I don't have a lucas@git.eclipse.org
account)
It seems like the repository for https://git.eclipse.org/r/plugins/gitiles/www.eclipse.org/eef/ has been moved to Github (see screenshot below), which might explain why that gitiles repo is no longer publicly available.
Request for a function
git-link-gitiles
https://gerrit.googlesource.com/gitiles/
Example file in Gitiles: https://gerrit.googlesource.com/gitiles/+/refs/heads/master/java/com/google/gitiles/DateFormatter.java