Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Cannot find the remote origin url #1

Closed
ionelmc opened this issue Feb 9, 2015 · 20 comments · Fixed by #26
Closed

error Cannot find the remote origin url #1

ionelmc opened this issue Feb 9, 2015 · 20 comments · Fixed by #26
Assignees
Labels

Comments

@ionelmc
Copy link

ionelmc commented Feb 9, 2015

Seems it doesn't work on my git-svn repo 😞

$ git-stats-importer
error Cannot find the remote origin url. Please add it.
@IonicaBizau IonicaBizau added the bug label Feb 9, 2015
@IonicaBizau
Copy link
Owner

What's the output of git config --get remote.origin.url?

@ionelmc
Copy link
Author

ionelmc commented Feb 9, 2015

On Mon, Feb 9, 2015 at 6:11 PM, Ionică Bizău notifications@github.com
wrote:

git config --get remote.origin.url

​No output at all. I don't have any remotes as you cannot push with a
git-svn repo.​

Thanks,
-- Ionel Cristian Mărieș, blog.ionelmc.ro

@IonicaBizau
Copy link
Owner

OK, so you have to add one. What do you mean by git-svn? Is it a git + svn repo? What is the remote url (where do you push the code)?

git-stats uses the remote urls to make differences between repositories.

@ionelmc
Copy link
Author

ionelmc commented Feb 9, 2015

This is git-svn: http://git-scm.com/docs/git-svn

Thanks,
-- Ionel Cristian Mărieș, blog.ionelmc.ro

On Mon, Feb 9, 2015 at 6:15 PM, Ionică Bizău notifications@github.com
wrote:

OK, so you have to add one. What do you mean by git-svn? Is it a git + svn
repo? What is the remote url (where do you push the code)?

git-stats uses the remote urls to make differences between repositories.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@ionelmc
Copy link
Author

ionelmc commented Feb 9, 2015

I have this tho:

$ git svn info
Path: .
URL: https://some.url.example.com/to/svn/repo/trunk
Repository Root: https://some.url.example.com/to/svn/repo
Repository UUID: a0b528ad-c7e9-41a2-9749-cad4148cc57a
Revision: 12341234
Node Kind: directory
Schedule: normal
Last Changed Author: maries
Last Changed Rev: 12341234
Last Changed Date: 2015-02-09 15:58:31 +0200 (Mon, 09 Feb 2015)

Regardless, relying on remote urls seems unnecessary, commits already have a good id: the hash - why can't you compare just on that?

@IonicaBizau
Copy link
Owner

Is there a way to get the the url only?

In the future I will probably make some stats regarding the repositories too.

In the meantime you can add a dummy remote url:

git remote add origin git@dummy.com:dummy/dummy.git

@philadams-zz
Copy link

Aha! git config --get remote.origin.url assumes, of course, that your default remote is named origin. Because I often have multiple remotes on different servers, my 'default' GitHub remote is usually named github.

Perhaps git-stats-importer can use something like git config --get remote.$(git remote | head -n1).url instead?

@IonicaBizau
Copy link
Owner

@philadams 👍 Can you create a pull request with this? Also, would it solve the issue with git-svn?

@nilleb
Copy link

nilleb commented Feb 18, 2015

I reproduce this bug on windows, on a pure git (pure, not bare) repository.

$ "Jenkins Integration\node_modules.bin\git-stats-importer"
error Cannot find the remote origin url. Please add it.

$ git config --get remote.origin.url
http://:@cgdlyovm0161:8080/tfs/tahaa/DT_FWK_GIT/_git/green

$ git config --get remote.$(git remote | head -n1).url
error: invalid key: remote.$(git
head: 1).url: number of lines is so large that it is not representable

@IonicaBizau
Copy link
Owner

Hmm... interesting.

What about the following?

$ git config --get remote.`git remote | head -n1`.url

@nilleb
Copy link

nilleb commented Feb 18, 2015

Same error message

error: invalid key: remote.`git
head: 1`.url: number of lines is so large that it is not representable

@IonicaBizau
Copy link
Owner

@nilleb What about git remote | head -n1? Maybe I will separate them in two exec calls.

@philadams-zz
Copy link

@IonicaBizau Yes - but I see you beat me to it! 👍

I confirm it's working just fine as importing in my repos now - thank you!

@nilleb
Copy link

nilleb commented Feb 19, 2015

splitting the instruction in two distinct instructions works.
but, pay attention to the part head -n1: the remotes are sorted alphabetically, not by their degree of importance (all the remotes are equal in importance).
in my case, the first remote doesn't correspond to the default one.

@IonicaBizau
Copy link
Owner

How should do we define the default remote?

@mrzepinski
Copy link

+1

@philadams-zz
Copy link

@nilleb @IonicaBizau I hadn't considered that. What exactly is the remote being used for? Just the remote.whatever.url as a key for the local commits cache? If so, I guess any remote regardless of importance would be fine?

@IonicaBizau
Copy link
Owner

@philadams In git-stats 2.0.0 the remotes will be kept in another way. Since the commit ids are unique, the can be stored in one object. And that makes the life easier.

@philadams-zz
Copy link

Nice - anticipating your future work with excitement. Love this project - thank you!

@IonicaBizau
Copy link
Owner

Thank you, @philadams, for nice words! 😄

git-stats 2.0.0 is almost here. ✨

See #26 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants