CandyShop / gerrit

Automatically exported from code.google.com/p/gerrit
Apache License 2.0
1 stars 0 forks source link

"Clone with commit-msg hook" command fails for project with / #3444

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: master (2.11.1-795-gdecc703)

What steps will reproduce the problem?
1. Install download-commands plugin
2. Create project foo/bar
3. Visit http://localhost:8080/#/admin/projects/foo/bar and run the displayed 
"Clone with commit-msg hook" command

What is the expected output? What do you see instead?
I expect to get a clone of the project with commit-msg hook installed.

Instead, I get:

 $ git clone http://localhost:8080/foo/bar && scp -p -P 29418 $USER@localhost:hooks/commit-msg foo/bar/.git/hooks/
 Cloning into 'bar'...
 Checking connectivity... done.
 warning: remote HEAD refers to nonexistent ref, unable to checkout.
 foo/bar/.git/hooks/: No such file or directory
 protocol error: expected control record

Please provide any additional information below.

GetServerInfo does:

 CloneCommand command = e.getProvider().get();
 String c = command.getCommand(scheme, "${project}");
 if (c != null) {
   info.cloneCommands.put(commandName, c);
 }

This implies an assumption that ${project} will end up in the clone command 
as-is without mangling. But a corrected clone command would use the basename.

It is tempting to put the clone commands in ProjectInfo instead.

Original issue reported on code.google.com by jrn@google.com on 22 Jun 2015 at 11:45

GoogleCodeExporter commented 9 years ago
> It is tempting to put the clone commands in ProjectInfo instead.

This could be done, but I like that with the current solution we return the 
clone commands only once and not with every project. This is why I attempted 
another fix [1,2].

[1] https://gerrit-review.googlesource.com/68858
[2] https://gerrit-review.googlesource.com/68857

Original comment by edwin.ke...@gmail.com on 23 Jun 2015 at 7:51

GoogleCodeExporter commented 9 years ago

Original comment by edwin.ke...@gmail.com on 23 Jun 2015 at 9:01