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

hub decides usernames shouldn't be capitalized #263

Closed
rsrchboy opened this issue Nov 22, 2012 · 14 comments
Closed

hub decides usernames shouldn't be capitalized #263

rsrchboy opened this issue Nov 22, 2012 · 14 comments

Comments

@rsrchboy
Copy link

Whenever I try to create, or fork, or.... a repo with hub, this happens:

athena p5/Dist-Zilla-Role-RegisterStash ‹master*› » hub create
Updating origin
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch origin
rsrchboy at athena in ~/work/p5/Dist-Zilla-Role-RegisterStash
rsrchboy at athena in ~/work/p5/Dist-Zilla-Role-RegisterStash
athena p5/Dist-Zilla-Role-RegisterStash ‹master*› » git remote -v 
origin  git@github.com:rsrchBoy/Dist-Zilla-Role-RegisterStash.git (fetch)
origin  git@github.com:rsrchBoy/Dist-Zilla-Role-RegisterStash.git (push)

As you can imagine, I feel pretty deflated and depressed that, well, my R is being squashed.

Note that the action succeeds (e.g. the repo was created).

@mislav mislav closed this as completed in d91214c Nov 22, 2012
@mislav
Copy link
Owner

mislav commented Nov 22, 2012

Thanks for the report! Fixed in master branch.

@rsrchboy
Copy link
Author

I suspect this runs deeper, unfortunately:

rsrchboy at athena in ~/work/p5/p5-Dist-Zilla-Plugin-GitHub
athena p5/p5-Dist-Zilla-Plugin-GitHub ‹master› » hub fork RsrchBoy
Updating rsrchBoy
X11 forwarding request failed
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch rsrchBoy
rsrchboy at athena in ~/work/p5/p5-Dist-Zilla-Plugin-GitHub
athena p5/p5-Dist-Zilla-Plugin-GitHub ‹master› » git remote -v
origin  git://github.com/ghedo/p5-Dist-Zilla-Plugin-GitHub.git (fetch)
origin  git://github.com/ghedo/p5-Dist-Zilla-Plugin-GitHub.git (push)
rsrchBoy        git@github.com:rsrchBoy/p5-Dist-Zilla-Plugin-GitHub.git (fetch)
rsrchBoy        git@github.com:rsrchBoy/p5-Dist-Zilla-Plugin-GitHub.git (push)

I'm happy to open a separate issue for this, if you'd like. :)

@rsrchboy
Copy link
Author

Something I realize I hadn't explicitly called out above: both the remote name and url are impacted.

@mislav
Copy link
Owner

mislav commented Nov 24, 2012

I think you entered it lowercase yourself when you first
authenticated. Check your ~/.config/hub

But sure, this is a bug. Even if you entered it wrong, hub should read
the correct capitalization from GitHub and store it that way

@mislav mislav reopened this Nov 24, 2012
@rsrchboy
Copy link
Author

Huh. I didn't even realize there was a ~/.hub/config; I thought hub just read from ~/.gitconfig (where github.user is set correctly) and stashed the oauth2 token... somewhere. le sigh

You're right; it was set as 'rsrchBoy' in hub's config; that's been corrected :)

@mislav mislav closed this as completed in bc361d0 Nov 24, 2012
@mislav
Copy link
Owner

mislav commented Nov 24, 2012

Nope hub doesn't read github.user anymore.

Just pushed a change that makes sure that the username gets stored with correct capitalization. However it's still possible to cause some commands to fail by entering your login name in wrong case the first time around. I don't worry too much about this, since Unix is mostly case-sensitive so this shouldn't be a surprise, and these edge-cases are hard to hit.

@rsrchboy
Copy link
Author

Awesome, thanks! :)

@sukima
Copy link

sukima commented Jun 19, 2013

How the bloody hell do you undo first time around?! I have deleted ~/.config/hub over and over and it never changes. It always gets the wrong capitalization! Where the heck is this stored? I don't understand.

@mislav
Copy link
Owner

mislav commented Jun 20, 2013

@sukima What is the issue you're struggling with? Your username contains only lowercase letters, so I don't think it's the same issue as in this thread?

@sukima
Copy link

sukima commented Jun 20, 2013

Apologies for the frustrated post. Heres what happened. I installed hub (via homebrew) I ran a github based command (like fork) and it asked for my OAuth key. I created one entered it in. I verified that ~/.config/hub has the proper lowercase for my name. Then running a command such as fork will create a fork on github but then add a remote to the current repo with a capitalized name. I then deleted ~/.config/hub. tried again same result. I then when to github and removed the OAuth API token and regenerated. removed ~/.config/hub and ran git fork. Same thing. Looked in ~/.config/hub and the old token was placed there. So some how hub is storing the old credentials somewhere and just copying them into ~/.config/hub for no good reason but to confuse the heck out of me.

Again apologies for the frustration and it is very possible that this is not related to this issue.

@mislav
Copy link
Owner

mislav commented Jun 20, 2013

Then running a command such as fork will create a fork on github but then add a remote to the current repo with a capitalized name.

Is the problem username ("sukima") capitalization or the capitalization of the repository name? If the latter, then it sounds like #253 and it has nothing to do with authentication or any information in ~/.config/hub. Can you describe your issue in more detail: e.g. what values did you expect and which were set by hub? Also hub version. Thanks

@sukima
Copy link

sukima commented Jun 20, 2013

Setup:

suki@Persephone:source$ git clone defunkt/hub
Cloning into 'hub'...
remote: Counting objects: 3558, done.
remote: Compressing objects: 100% (2088/2088), done.
remote: Total 3558 (delta 1735), reused 3176 (delta 1383)
Receiving objects: 100% (3558/3558), 1.06 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (1735/1735), done.
suki@Persephone:source$ cd hub
suki@Persephone:hub (master)$ git fork
Updating Sukima
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch Sukima

Checking github.com forkwas created. Then checking remotes.

Expected:

$ git remote show
sukima
origin
$ git remote show sukima
* remote sukima
  Fetch URL: git@github.com:sukima/hub.git
  Push  URL: git@github.com:sukima/hub.git
  HEAD branch: master
  Remote branches:
    gh-pages        new (next fetch will store in remotes/sukima)
    master          new (next fetch will store in remotes/sukima)
    pullrequest-msg new (next fetch will store in remotes/sukima)
  Local ref configured for 'git push':
    master pushes to master (up to date)

instead I get:

$ git remote show
Sukima      <-- not correct
origin
$ git remote show Sukima
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git remote show -n Sukima
* remote Sukima
  Fetch URL: git@github.com:Sukima/hub.git    <-- Again not correct
  Push  URL: git@github.com:Sukima/hub.git
  HEAD branch: (not queried)
  Local ref configured for 'git push' (status not queried):
    (matching) pushes to (matching)

My ~/.config/hub:

---
github.com:
- user: sukima
  oauth_token: OLD_TOKEN
- user: sukima
  oauth_token: OLD_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN
- user: sukima
  oauth_token: NEW_TOKEN

I have no idea why this file just keeps getting longer and longer.

git version 1.8.3.1
hub version 1.10.6

@mislav
Copy link
Owner

mislav commented Jun 20, 2013

Do you by chance have $GITHUB_USER environment variable set to "Sukima"? Otherwise I can't see how the capitalized version of your username could have gone into the fork command, when your ~/.config/hub clearly indicates that your name is lowercase

@sukima
Copy link

sukima commented Jun 20, 2013

You have got to be kidding me?! After all that it was the $GITHUB_USER variable! 😥

I feel a little silly now. I apologize for spamming this conversation. Good news is if someone else gets bit with this Google might find this thread.

@mislav, thank you, you are clever.

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

No branches or pull requests

3 participants