| Summary: | Git repositories that are Gerrit-enabled show wrong ssh urls on http://git.eclipse.org/c | ||
|---|---|---|---|
| Product: | Community | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Gerrit | Assignee: | Eclipse Webmaster <webmaster> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | daniel_megert, denis.roy, michael, pascal, roger |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
|
Description
Markus Keller
I'm not sure how I could, from a C program, detect that a repo is using Gerrit. For now the best I can do is remove the SSH URLs from all the repos. The outcome of bug 379652 was to keep the original ssh URL working for Eclipse SDK projects, so this is not an issue any more for these projects. That makes this bug low prio for me. > I'm not sure how I could, from a C program, detect that a repo is using Gerrit. This problem only shows up for repos where Gerrit has exclusive write access. The C program could execute "stat -c %U <path-to-repo>", and if the result is "gerrit", then it could add the port and strip "gitroot/". > For now the best I can do is remove the SSH URLs from all the repos. Please leave them -- they're valid in many cases and still better than nothing. *** Bug 426957 has been marked as a duplicate of this bug. *** I stumbled on this one as well. Maybe worth adding a general comment (on ALL pages), along these lines: NOTE: If the repository is managed via Gerrit, you need a different URL (link to Gerrit Wiki page). I should be able to look at the file owners to determine it is a Gerrit-owned repo, and make something intelligent of it. cGit is written in C, which is not my strong suit. I've got this mostly working. Compare a pure Git repo: http://git.eclipse.org/c/datatools/org.eclipse.datatools.build.git/ To a Gerrit repo: http://git.eclipse.org/c/cdo/cdo.git/ I do need to strip ".git" from the URL, but I'm not sure how to do that in C. Here is the code snippet: if (strcmp(ctx.repo->owner, "Code Review") == 0) { // TODO: strip ".git" from suffix print_url("https://git.eclipse.org/r/#/admin/projects", suffix); break; } else { print_url(h, suffix); } Anyone knowledgeable with C out there? Where's Doug when you need him. I think I can call this one fixed. For plain git repos, the usual three clone URLs are shown http://git.eclipse.org/c/actf/org.eclipse.actf.ai.git/ For Gerrit-enabled repos, I link to Gerrit Code Review, which has all the clone URLs. http://git.eclipse.org/c/cdo/cdo.git/ > For plain git repos, the usual three clone URLs are shown That's also the case for Gerrit-enabled repos that still offer direct access: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/ I think I'll do this:
- list the anonymous clone URLs (http & git) for all repos
- remove SSH since it only applies to committers, and they already receive instructions from webmaster on how to access their repos
- Link to Gerrit as I do now, for those repos that are owned by Gerrit.
While at the Gerrit User Summit 2014, it was stated that discouraging the usage of Gerrit for anonymous cloning is highly desirable.
> for Gerrit-enabled repos that still offer direct access:
That's a corner case that we don't encourage. From cGit, unless the repo is owned by Gerrit, I can't easily determine the presence of Gerrit. Sorry.
(In reply to Denis Roy from comment #9) > - remove SSH since it only applies to committers, and they already receive > instructions from webmaster on how to access their repos No, that would be bad. I often have to clone some rarely used repos and for that I just want to be able to copy/paste the SSH URL. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. I'm going to close this as 'worksforme' since nothing has changed in the last 2 years.
It's been a loooong time since I've written C, but I think something like the following *should* work
if (strcmp(ctx.repo->owner, "Code Review") == 0) {
// TODO: strip ".git" from suffix
char * destsuffix;
strncpy(destsuffix,suffix,strcspn(suffix,".git"));
print_url("https://git.eclipse.org/r/#/admin/projects", destsuffix);
break;
}
else {
print_url(h, suffix);
}
|