git-autoconfig icon indicating copy to clipboard operation
git-autoconfig copied to clipboard

sshCommand added - now the extension allows to set different SSH keys for different usernames per repository

Open rotaryden opened this issue 3 years ago • 9 comments

So the main reason for this - is to allow git-autoconfig to manage different SSH keys per repository for different Git accounts; this works perfectly for different Github accounts as well. Is extremely useful for me working on different clients.

Please refer here https://superuser.com/a/912281 for a good answer about sshCommand

Changed also: dependencies and vscode main libs updated according to latest "yo code" generations; Typescript updated to 4.2, cimpile errors fixed; test mocks renewed to the new structure according to the latest "yo code"

I've built an VSIX and tested on my VSCode instance - looks like works okay.

TODO: I've added some try-catches to migrate existing configs without "sshCommand" field but still some room to test it

Thanks!

rotaryden avatar Apr 15 '21 13:04 rotaryden

Thanks @rotaryden ! That's a great addition to the extension. I'll merge it and publish new version this weekend (probably on 18th. of April).

ShyykoSerhiy avatar Apr 16 '21 00:04 ShyykoSerhiy

I try to use

"git-autoconfig.configList": [
        {
            "user.name": "pro",
            "user.email": "[email protected]",
            "core.sshCommand": "ssh -i ~/.ssh/id_rsa_pro"
        },
        {
            "user.name": "name",
            "user.email": "[email protected]"
        }
    ]

...then select pro user and sshCommand doesn't write to config file. What's wrong?

pashakiz avatar May 23 '22 18:05 pashakiz

Oops... It's not merged yet :) Merge please :)

pashakiz avatar May 23 '22 18:05 pashakiz

@ShyykoSerhiy, can you merge it?

pashakiz avatar Jun 10 '22 11:06 pashakiz

@rotaryden, can I use you fork? Is there a way to install it directly in VS Code?

pashakiz avatar Jul 27 '22 16:07 pashakiz

Hi @pashakiz yes, you can - just assemble vsix from it and add it to VSCode manually https://code.visualstudio.com/api/working-with-extensions/publishing-extension

rotaryden avatar Jul 27 '22 16:07 rotaryden

going to publish my fork soon in the market

rotaryden avatar Jul 27 '22 16:07 rotaryden

https://marketplace.visualstudio.com/items?itemName=rotaryden.git-autoconfig-plus

@pashakiz - here is my version in the market already I hope @ShyykoSerhiy won't object.

also changed

  "activationEvents": [
        "onStartupFinished"
    ],
    

it was "*" and likely performance was affected

rotaryden avatar Jul 31 '22 09:07 rotaryden

@rotaryden, Great!! Thanks!

pashakiz avatar Jul 31 '22 09:07 pashakiz