Your comments

Hi Marc,

Thanks for continued work on this.
I did  a quick test,
Upgraded to the latest

deleted the Azure Devops hosting provider
Used OAuth, entered the Authorization code, and smartgit got stuck at this

It looks like it got past org1 but got stuck on org2
This is what I see in the logs

7m24s510 (2021-04-09 15:36:43) [main] INFO q.swt.shellActivation - Activation change from Shell {Add Hosting Provider}@3ED7DD70 to Shell {Checking connectivity}@5F935D49
7m24s512 (2021-04-09 15:36:43) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO smartgit.azure - Sending OAuth request https://app.vssps.visualstudio.com/oauth2/token
7m24s524 (2021-04-09 15:36:43) [main] INFO q.swt.shellActivation - Activation remains at Shell {Checking connectivity}@5F935D49
7m24s726 (2021-04-09 15:36:43) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://app.vssps.visualstudio.com/_apis/profile/profiles/me'
7m24s871 (2021-04-09 15:36:43) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://app.vssps.visualstudio.com/_apis/accounts'
7m25s 31 (2021-04-09 15:36:43) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://app.vssps.visualstudio.com/_apis/accounts'
7m25s285 (2021-04-09 15:36:44) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO smartgit.azure - Sending OAuth request https://app.vssps.visualstudio.com/oauth2/token
7m25s489 (2021-04-09 15:36:44) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org1/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=0'
7m25s706 (2021-04-09 15:36:44) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org2/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=0'
7m25s921 (2021-04-09 15:36:44) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org2/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=50'
7m26s369 (2021-04-09 15:36:45) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org2/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=100'
7m26s686 (2021-04-09 15:36:45) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org2/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=150'
7m27s138 (2021-04-09 15:36:46) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org2/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=200'
7m27s540 (2021-04-09 15:36:46) [ThreadPool-0 (smartgit.TM$$Lambda$853/0x000000010070d040)] INFO q.json - Sending GET 'https://dev.azure.com/org2/_apis/git/repositories?api-version=6.1-preview.1&$top=50&$skip=250'

I can confirm that anything (not username) worked for me as well.
I learned something new today, so PATs don't need the associated username.


Thanks

@Marc,
As I previously reported, manually changing the Account never worked for me, I couldn't add the second Organization as a Hosting Provider, even as a first Azure  DevOps hosting Organization.

@Martillo
> although a while back I had switched to the new https://dev.azure.com/[org]
format. Nevertheless, I was still able to use SmartGit to push changes
to the remote branch,

Both formats works for now, but according to MS notes, see this
https://docs.microsoft.com/en-us/azure/devops/release-notes/2018/sep-10-azure-devops-launch#administration


> but the Azure logo wasn't being displayed in the
SmartGit "Branches" window. When I changed the origin in SmartGit to
point to https://[org].visualstudio.com then the Azure logo showed up
Interesting, for me it was the inverse, we're still using the older domain for the concern highlighted above, and only after changing the repo properties in Smartgit to point to dev.azure.com I was able to get the Azure Logo

I would expect this to work

git clone https://anything:<PAT>@dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName

but I don't like including the username/PAT in the repo properties, I much rather add a hosting provider which would hide the details (for security), and let SmartGit use the credentials from there.
Does that make sense?
And for that to work, when adding a hosting provider, I would need to provide username and PAT

PS: come to think of it, were you literally asking if `anything` instead of the username would work with PAT.

Hi Marc, I'm not sure I totally understand the question, but from a user perspective, once they add a Hosting Provider of type Azure DevOps, then any repo the domain dev.azure.com or *.visualstudio.com should be treated as Azure DevOps repo.
One has the Organization name in the domain, the other in the path, that's the only difference.

Just to be complete,

- The ability to choose the organization should be added otherwise it is impossible to use an organization that is not the first entry.
- `Account` should be renamed to `Organization` to be clearer as one can get it confused with email account.
- Lastly, for PAT to work, one needs to provide an email address, so that field needs to be requested in the PAT dialog along with the Organization.

the older domain is always visualstudio.com with the format: org.visualstudio.com so yes, it could definitely be detected.

Update:
Regenerated the Token and am now seeing the PRs :)

@Marc,

Sorry for the delayed response, didn't realize that you had responded, just realized that your response was nested higher up.
Confusing if you ask me, as I would need to go all over my past posts to see if there were any further comments / responses on it.

In any case, here's more feedback.
1- Both rundll commands work with all browsers except Firefox, it appears that this is specific to my instance of Firefox and that also worked on another system, so you can ignore that issue.
2- Digging further on why I was not seeing the Azure logo on branches, it dawned on me that our organization still uses the older visualstudio domain format

`https://org.visualstudio.com` instead of `https://dev.azure.com/org`

https://docs.microsoft.com/en-us/azure/devops/release-notes/2018/sep-10-azure-devops-launch#administration

Switching one of the repos to the new domain format, I'm able to see the Azure logo on the Branches, however I'm also seeing this