Your comments

Re: the URL issue - "Utilities" is the name of the project. "Utilities" is also the name of the only repository in that project. Ultimately it's not an issue since I can simply change the origin in SmartGit to use the dev.azure.com URL, but if I get some time later today I'll try your suggestions.

@Marc and @Hrant - my visualstudio.com test above may not be legit... 


My org is currently configured to use the new https://dev.azure.com/[org name] URL, but I can still pull and push code from SmartGit using the old https://[org name].visualstudio.com/_git/[repo name] URL. I discovered this because there were some repos that I hadn't worked with in a while which were still configured in SmartGit to use the old URL scheme. Pull and push works, but the Azure icon doesn't display and no Pull Request information is available. There's no "DefaultCollection" element in this URL; I don't know if my Azure DevOps repo URLs ever included a "DefaultCollection"...

@Marc - thanks for all the hard work! I grabbed the latest version and was able to successfully click through from SmartGit to view a pull request in a web browser, as well as successfully abandon a pull request from within SmartGit. Looks pretty good! The only remaining issue, if it is one, is that repos where the origin URL is specified as https://[org].visualstudio.com don't show the Azure logo in SmartGit.

re: supporting Azure DevOps orgs that use the visualstudio.com URL: These still work in SmartGit, but you don't get the added Azure DevOps specific features. The visualstudio.com URL is deprecated, but I agree that full Azure DevOps support for it would be nice since it can be time-consuming for dev teams to change the origin URL for a bunch of active repos. However I would rate support for this a lower priority and schedule it for a future release if you don't have bandwidth to work on it now. I agree there should be something in the docs about it. 

re: generating an OAuth token for org #2: the other day, I copied the URL that generates the token, then logged into the Azure DevOps account for org #2 using my separate Org #2 Microsoft account, pasted the URL into the browser location bar, hit enter and if I recall correctly a token was generated but when I tried to use it, it didn't work. I tried about three times, but didn't have time to pursue it any further than that.

re: one user > multiple Azure DevOps accounts. I think this could be very common. I have an account for my consulting business. I also had an account at my previous day job (where I purchased 20 or 30 or maybe more SmartGit licenses), and another account with a separate MS login that belongs to a company for which I'm doing some consulting.

re: viewing a hosting provider's authentication method (PAT or OAuth) when managing hosting providers: nice to have but I'm sure users can live without it.

re:  "Abandon" and "Reject" : I agree with hrant that both actions should be available for Azure DevOps repos. To me the words "Abandon" and "Retract" express the same concept.... There is a StackOverflow post from August 31 2020 stating "GitHub now supports closing a pull request" - GitHub Close looks like it corresponds to the Azure DevOps Abandon action.

I played around with the new build for a little bit and it looks good! The announcement of the new Azure DevOps feature in the lower right corner at startup is awesome.

I tested connecting using an OAuth token when "Allow Third-party Application access via OAuth" was turned off for the org in Azure DevOps (see screenshot) and got an HTTP 401 response, so it would helpful to add some instructional text in the dialog box to note that this needs to be turned on in the org. Also, I had real problems creating an OAuth token for an org where I authenticate with a different MS account than the one I'm logged into my Windows workstation with, so I gave up and used a PAT instead. Since authenticating with OAuth tokens for multiple MS accounts could be problematic, you might get fewer support request from users if you encourage PATs over OAuth. For PATs, it would also be helpful to add some text on the Azure DevOps Configure Hosting Provider dialog to explain that a PAT only needs Code Read/Write permissions but access to all accessible orgs.

One note: I think it would be nice if SmartGit indicated which authentication method is being used - PAT or OAuth - when you edit an existing Azure DevOps hosting provider.

The Pull Requests link is showing up but I haven't experimented much yet with the functionality. BTW , by "Retract Pull Request" do you mean "Abandon"? I think the official Azure DevOps term for this is "Abandon Pull Request" (https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops)


@Marc - thanks for working on this! I'm going to do some testing as soon as I can carve out a few free minutes

Since all you need is a PAT to give a user access to one or more of the Azure DevOps organizations they have access to via a given Microsoft (or Azure AD) Account, and since a user may have access to multiple Azure DevOps instances using different Microsoft/Azure AD logins, I'm thinking that what the Hosting Providers configuration in SmartGit should provide is a way to record and track the different Azure DevOps PATs a user has, and which Azure DevOps organizations each PAT gives them access to so that SmartGit can inject the correct PAT into a request to connect to a given Azure DevOps repo.

@Marc - apologies, I didn't see your earlier post last night when I added the post above. 


I just ran the code below at the command line and successfully cloned two repos from projects in two different orgs that are both accessible via a single PAT that's tied to one Azure DevOps profile (which appears to be tied to a specific Microsoft account). I was also able to clone another repo in another org using a different PAT I created in another Azure DevOps account that's tied to a different Azure DevOps profile/MS account. No dialogs popped up to ask me to log into my MS account, so it was all very smooth.

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

I have an Azure DevOps project that I created a while back to test branching in Azure DevOps. In SmartGit, the origin for the repos in this project in SmartGit was still set to the old https://[org].visualstudio.com URL,  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, 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. However, there's an active pull request on this repo, but I don't see it in SmartGit, even after regenerating the token and selecting View > Refresh in the menu.

One note about creating the token. I have two Azure DevOps orgs configured as hosting providers in SmartGit (call them Org A and Org B).  If I open up the Hosting Providers dialog and:

  1. Select Org B
  2. Click the Edit button
    1. In the "Configure Azure DevOps account dialog, Org B is displayed in the account field
  3. I click the Generate Token button
  4. The "Enter the generated code" dialog box opens up
  5. A browser window opens up on https://www.syntevo.com/smartgit/azuredevops-callback and displays a token to copy
  6. I copy the token
  7. I paste the token into the "Code" field in the "Enter generated code" field dialog 
  8. I click the OK button
  9. The "Enter generated code" dialog closes
  10. The "Account" field in the "Configure Azure DevOps account" dialog now displays Org A instead of Org B in the Account field