zgauthier8286 / git-repo

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

repo sync mangles remote.origin.url for manifest repository #99

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
repo sync mangles remote.origin.url for a manifest repository.

The NG operation is this git config operation:

: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git/config 
--replace-all remote.origin.url 
git@github.com:norton/git@github.com:norton/manifests 1>| 2>|

The correct url is "git@github.com:norton/manifests.git".

The NG url is "git@github.com:norton/git@github.com:norton/manifests".

This behavior seems to have been introduced recently.

Affected Version:

repo version v1.7.8.1
       (from https://android.googlesource.com/tools/repo)
repo launcher version 1.14
       (from /Users/norton/bin/repo)

Environment:

git version 1.7.8
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

What steps will reproduce the problem?
1. fetch repo tool

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

2. repo init

$ repo --trace init -q -u git@github.com:norton/manifests.git -m 
ubf-default-rw.xml

3. repo sync

$ repo --trace sync -q

What is the expected output?

repo sync should work normally as expected.

What do you see instead?

$ repo --trace init -q -u git@github.com:norton/manifests.git -m 
ubf-default-rw.xml
gpg: keyring `/Users/norton/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/Users/norton/.repoconfig/gnupg/pubring.gpg' created
gpg: /Users/norton/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer <repo@android.kernel.org>" 
imported
gpg: Total number processed: 1
gpg:               imported: 1

: git --version 1>|
: export GIT_DIR=/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git
: git init 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git/config --null 
--list 1>| 2>|
: git config --file /Users/norton/.gitconfig --null --list 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git/config 
--unset-all core.bare 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git/config 
--replace-all remote.origin.url git@github.com:norton/manifests.git 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git/config 
--replace-all remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 1>| 2>|
: ssh -o ControlPath /tmp/ssh-mNlGj5/master-%r@%h:%p git@github.com -O check
: ssh -M -N -o ControlPath /tmp/ssh-mNlGj5/master-%r@%h:%p git@github.com
: git fetch origin --tags +refs/heads/*:refs/remotes/origin/*
remote: Counting objects: 369, done.
remote: Compressing objects: 100% (243/243), done.
remote: Total 369 (delta 288), reused 175 (delta 126)
Receiving objects: 100% (369/369), 1.44 MiB | 728 KiB/s, done.
Resolving deltas: 100% (288/288), done.
From github.com:norton/manifests
 * [new branch]      dev        -> origin/dev
 * [new branch]      master     -> origin/master
: git pack-refs --all --prune 1>| 2>|
: load refs /Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git
: git rev-parse --verify refs/remotes/origin/master^0 1>| 2>|

: cd /Users/norton/chibihub/dev/ubf-all-github/.repo/manifests
: git read-tree --reset -u -v HEAD
: scan refs /Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git

Your identity is: Joseph Wayne Norton <norton@alum.mit.edu>
If you want to change this, please re-run 'repo init' with --config-name

repo initialized in /Users/norton/chibihub/dev/ubf-all-github

$ repo --trace sync -q
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git/config --null 
--list 1>| 2>|
: unpickle /Users/norton/.gitconfig
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/repo/.git/config --null --list 
1>| 2>|
: ssh -o ControlPath /tmp/ssh-ENqjQC/master-%r@%h:%p git@github.com -O check
: ssh -M -N -o ControlPath /tmp/ssh-ENqjQC/master-%r@%h:%p git@github.com
: export GIT_DIR=/Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git
: git fetch --quiet origin --tags +refs/heads/*:refs/remotes/origin/*
: load refs /Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git
: git symbolic-ref -m manifest set to refs/heads/master refs/remotes/m/master 
refs/remotes/origin/master 1>| 2>|
: scan refs /Users/norton/chibihub/dev/ubf-all-github/.repo/manifests.git

: export 
GIT_DIR=/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git
: git init 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git/config 
--null --list 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git/config 
--unset-all core.bare 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git/config 
--replace-all remote.origin.url 
git@github.com:norton/git@github.com:norton/manifests 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git/config 
--replace-all remote.origin.projectname manifests 1>| 2>|
: git config --file 
/Users/norton/chibihub/dev/ubf-all-github/.repo/projects/manifests.git/config 
--replace-all remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 1>| 2>|
: git fetch --quiet origin --tags +refs/heads/*:refs/remotes/origin/*
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
^CKilled by signal 2.

Please provide any additional information below.

The sync operation works properly if an https prefixed url (anonymous GitHub 
access) is given as the manifest url.

Original issue reported on code.google.com by josephwn...@gmail.com on 10 Dec 2011 at 2:07

GoogleCodeExporter commented 8 years ago
Hi. Is there any updates on this? I believe this issue is still remaining on 
the latest repo.

----
$ repo sync
Fetching projects:  77% (14/18)  fatal: remote error: 
  hibari/git@github.com:hibari/qc is not a valid repository name
----

I'm working around by adding followings to ~/.gitconfig but I'd be happy if 
this issue is addressed.

----
[url "git@github.com:hibari/qc.git"]
     insteadOf = git@github.com:hibari/git@github.com:hibari/qc
----

----
$ repo --version
repo version v1.12.1
       (from https://gerrit.googlesource.com/git-repo)
repo launcher version 1.19
       (from /home/tatsuya/bin/repo)
git version 1.7.11.7
Python 2.7.3 (default, Jul 24 2012, 10:05:38) 
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)]
----

Original comment by tatsuya6...@gmail.com on 6 Feb 2013 at 10:31

GoogleCodeExporter commented 8 years ago
I'm having this problem too. The bug is that manifest_xml.py:_resolveFetchUrl() 
calls urlparse.urljoin(), which treats the colon as a port specification.

It's possible to avoid the problem by specifying the url as ssh://... (eg 
ssh://github.com/hibari/qc)

Original comment by philipjc...@gmail.com on 29 Apr 2013 at 7:56

GoogleCodeExporter commented 8 years ago
phillpjc Your work-around is acceptable for me.  Thanks for the suggestion.

Original comment by josephwn...@gmail.com on 23 Jun 2013 at 8:27