Issue 3444: "Clone with commit-msg hook" command fails for project with /
Status:  Released
Owner: ----
Closed:  Jun 2015
Project Member Reported by jrn@google.com, Jun 22, 2015
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.
Jun 23, 2015
Project Member #1 edwin.ke...@gmail.com
> 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
Status: ChangeUnderReview
Jun 23, 2015
Project Member #2 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.12
Dec 21, 2015
Project Member #3 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released