hub is requesting authentication on all commands

Created on 6 Nov 2019  ยท  3Comments  ยท  Source: github/hub

Right after updating from 2.12.0 to 2.13.0, I started seeing the following prompts on any hub command:

โฏ hub compare $(git rev-parse --abbrev-ref HEAD)
github.com username:

I don't recall previously having to authenticate to use non-API functions of hub, did something change?

Most helpful comment

This change was in 2.12.8 https://github.com/github/hub/commit/1282f19c71a84ac27b13019d9a3e53eb5265ba20. You are prompted because hub compare wanted to be generally better at detecting the upstream branch, and for that it needs your GitHub username. This logic actually doesn't get executed in your case since you passed a git SHA explicitly, but your credentials would get used in case hub compare was called without arguments. So we log you in preemptively.

I understand how this might have affected you, but I consider these non-breaking changes. _Most_ hub commands will need your GitHub credentials, and so it makes no sense to try using hub without authenticating. Furthermore, authentication is only ever done once per machine.

All 3 comments

This change was in 2.12.8 https://github.com/github/hub/commit/1282f19c71a84ac27b13019d9a3e53eb5265ba20. You are prompted because hub compare wanted to be generally better at detecting the upstream branch, and for that it needs your GitHub username. This logic actually doesn't get executed in your case since you passed a git SHA explicitly, but your credentials would get used in case hub compare was called without arguments. So we log you in preemptively.

I understand how this might have affected you, but I consider these non-breaking changes. _Most_ hub commands will need your GitHub credentials, and so it makes no sense to try using hub without authenticating. Furthermore, authentication is only ever done once per machine.

@mislav thank you for the detailed explanation! Surprised I hadn't already logged in on this machine :)

@nicksergeant No worries, thanks for bringing this up! It's really useful to know for me that people often aren't logged in for some commands and that changes to chose commands affect them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

segevfiner picture segevfiner  ยท  4Comments

xxmyjk picture xxmyjk  ยท  4Comments

kentcdodds picture kentcdodds  ยท  4Comments

kurko picture kurko  ยท  4Comments

aryan9600 picture aryan9600  ยท  3Comments