Using repo script for non-android products

386 views
Skip to first unread message

Gaurav Negi

unread,
Aug 17, 2015, 3:13:43 PM8/17/15
to Repo and Gerrit Discussion
Dear repo experts,
   I am trying to use 'repo'  on a GIT project.

1. That is not android based.
2. That is not Gerrit based, just pure GIT based
3. That uses git protocol for cloning (not ssh)
    git clone git@<server>:<GIT project name>

  e.g.
    git clone g...@gitserver.company.com:GITproject

Can I use repo script for that?

What else I need to change in manifest.xml file? Following manifest.xml is not working. 


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

<manifest>

<remote  name="titan-stage"

           fetch="g...@titan-stage.corp.nutanix.com"

            />

<default revision="refs/heads/master"

         remote="titan-stage"

         sync-j="4" />

  <project path="main"  remote="titan-stage" name="main"  revision="master" />

  <project path="es_main" remote="titan-stage"  name="es_main" revision="master"/>

</manifest>


I use following command to clone individual repo


Can anyone please suggest what change is needed in manifest.xml. May be the fetch part is not correct with git as protocol. 

Thanks
-Gaurav

Magnus Bäck

unread,
Aug 17, 2015, 4:28:54 PM8/17/15
to Gaurav Negi, Repo and Gerrit Discussion
On Monday, August 17, 2015 at 21:13 CEST,
Gaurav Negi <gaura...@gmail.com> wrote:

> I am trying to use 'repo' on a GIT project.
> 1. That is not android based.
> 2. That is not Gerrit based, just pure GIT based
> 3. That uses git protocol for cloning (not ssh)
> git clone git@<server>:<GIT project name>
> e.g.
> git clone g...@gitserver.company.com:GITproject
> Can I use repo script for that?

Yes.

> What else I need to change in manifest.xml file? Following manifest.xml
> is not working.

It would help if you were a bit more descriptive than "is not working".
What happens? Do you get an error message? What if you use the --trace
option ("repo --trace init" etc)?

> <?xml version="1.0" encoding="UTF-8"?>
>
> <manifest>
>
> <remote name="titan-stage"
> fetch="g...@titan-stage.corp.nutanix.com" />

I wonder if Repo might dislike the URL. I'd try
ssh://g...@titan-stage.corp.nutanix.com.

[...]

--
Magnus Bäck | Software Engineer, Development Tools
magnu...@sonymobile.com | Sony Mobile Communications

Gaurav Negi

unread,
Aug 17, 2015, 4:48:33 PM8/17/15
to Gaurav Negi, Repo and Gerrit Discussion
Thanks Magnus for the reply.

Now I am getting this error

[gnegi@gnegi-VM2 tmp]$ repo sync

Traceback (most recent call last):

  File "/home/gnegi/sandbox/tmp/.repo/repo/main.py", line 513, in <module>

    _Main(sys.argv[1:])

  File "/home/gnegi/sandbox/tmp/.repo/repo/main.py", line 489, in _Main

    result = repo._Run(argv) or 0

  File "/home/gnegi/sandbox/tmp/.repo/repo/main.py", line 140, in _Run

    copts, cargs = cmd.OptionParser.parse_args(argv)

  File "/home/gnegi/sandbox/tmp/.repo/repo/command.py", line 67, in OptionParser

    self._Options(self._optparse)

  File "/home/gnegi/sandbox/tmp/.repo/repo/subcmds/sync.py", line 175, in _Options

    self.jobs = self.manifest.default.sync_j

  File "/home/gnegi/sandbox/tmp/.repo/repo/manifest_xml.py", line 334, in default

    self._Load()

  File "/home/gnegi/sandbox/tmp/.repo/repo/manifest_xml.py", line 402, in _Load

    self._ParseManifest(nodes)

  File "/home/gnegi/sandbox/tmp/.repo/repo/manifest_xml.py", line 455, in _ParseManifest

    remote = self._ParseRemote(node)

  File "/home/gnegi/sandbox/tmp/.repo/repo/manifest_xml.py", line 628, in _ParseRemote

    return _XmlRemote(name, alias, fetch, manifestUrl, review, revision)

  File "/home/gnegi/sandbox/tmp/.repo/repo/manifest_xml.py", line 75, in __init__

    self.resolvedFetchUrl = self._resolveFetchUrl()

  File "/home/gnegi/sandbox/tmp/.repo/repo/manifest_xml.py", line 85, in _resolveFetchUrl

    manifestUrl = self.manifestUrl.rstrip('/')

AttributeError: 'NoneType' object has no attribute 'rstrip'

Gaurav Negi

unread,
Aug 17, 2015, 5:10:55 PM8/17/15
to Gaurav Negi, Repo and Gerrit Discussion
Hi Magnus and others,
   I fixed the manifest repo. Now python error is gone.
But following error is coming up.
We are using gitosis for repo protection, this seeor generally comes when repo name is not correct. 

It could be because repo is getting the correct GIT URL.


[gnegi@gnegi-VM2 tmp]$ repo sync

Fetching project es_main

Fetching project main

ERROR:gitosis.serve.main:Repository read access denied

fatal: Could not read from remote repository.


Please make sure you have the correct access rights

and the repository exists.

ERROR:gitosis.serve.main:Repository read access denied

fatal: Could not read from remote repository.


Please make sure you have the correct access rights

and the repository exists.

Gaurav Negi

unread,
Aug 17, 2015, 5:52:52 PM8/17/15
to Gaurav Negi, Repo and Gerrit Discussion
All,
    I got some idea, but not sure how to fix it. 


1. I am running command this for repo init

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

it creates a .repo directory

2. running "git remote -v" inside .repo/projects/main.git directory, says this.

$ git remote -v

titan-stage g...@titan-stage.corp.nutanix.com:manifest/g...@titan-stage.corp.nutanix.com/main (fetch)

titan-stage g...@titan-stage.corp.nutanix.com:manifest/g...@titan-stage.corp.nutanix.com/main (push)


It should however be 


3. My default.xml is 

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

<manifest>

<remote  name="titan-stage"

           fetch="g...@titan-stage.corp.company.com"

           />

<default revision="master"

         remote="titan-stage"

                  sync-j="4" />

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

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

</manifest>


I tried it with
     fetch="ssh://g...@titan-stage.corp.company.com"

It didnot work. 

If anyone has any input, please let me know. 

Thanks
-Gaurav
Reply all
Reply to author
Forward
0 new messages