zgauthier8286 / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo sync not working when git protocol is being used instead of ssh #202

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Affected Version:
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# increment this whenever we make important changes to this script
VERSION = (1, 21)

Environment: Centos6

What steps will reproduce the problem?

1. We use git protocol in cloning the code

git clone git@titan-stage.corp.company.com:main

2. I want to make it repo specific, so I created a new GIT repo manifest.
   I can now clone manifest repo as

git clone git@titan-stage.corp.company.com:manifest

3. Content of default.xml in that manifest repo is this

<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<remote  name="titan-stage"

           fetch=".."

           />

<default revision="master"

         remote="titan-stage"

                  sync-j="4" />

  <project path="main"   name="main" revision="master" />

  <project path="toolbox"  name="toolbox" revision="master" />

</manifest>

4. I now do "repo init" like this

repo init -u git@titan-stage.corp.company.com:manifest

It works okay.

5. Now doing "repo sync" says gitosis error, that generally comes, when the GIT 
URL is not right. 

$ repo sync

Fetching project main

Fetching project toolbox

ERROR:gitosis.serve.main:Arguments to command look dangerous

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

6. I goes to .repo/projects/main.git and do "git remote -v"

It says 

titan-stage  git@titan-stage.corp.company.com:manifest/../main

which is wrong.

It should have said

titan-stage git@titan-stage.corp.company.com:main

OR

 titan-stage    git@titan-stage.corp.company.com:/main

Any idea, why the "repo init" URL gets appended to the URL of the repos I 
intent to clone via "repo init" and "repo sync"? Anything I can do to fix it?

What is the expected output? What do you see instead?

repo sync should work, but looks like it is not parsing the right URL.
It is saying URL as 
 git@titan-stage.corp.company.com:manifest/../main

it should however be
git@titan-stage.corp.company.com:/main

Please provide any additional information below.

Original issue reported on code.google.com by gaurav.negi@gmail.com on 20 Aug 2015 at 5:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
refer to this comment

https://code.google.com/p/git-repo/issues/detail?id=166#c1

Original comment by jagdeep....@gmail.com on 7 Sep 2015 at 2:16