Skip to content

Git is calling plink with the wrong parameter - lower-case P instead of upper-case P #2018

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

Closed
1 task done
pcolmer opened this issue Jan 10, 2019 · 8 comments
Closed
1 task done

Comments

@pcolmer
Copy link

pcolmer commented Jan 10, 2019

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.20.1.windows.1
cpu: x86_64
built from commit: 7c9fbc07db0e2939b36095df45864b8cda19b64f
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17763.253]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path:
Path Option: Cmd
Plink Path: C:\Users\phili\plink.exe
SSH Option: Plink
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I have PuTTY release 0.70 installed

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

git clone ssh://git@bitbucket.linaro.org:7999/its/project-portal-scripts.git
  • What did you expect to occur after running these commands?

I expect the system to use my SSH key hosted in Pageant to authenticate and then clone the repository.

  • What actually happened instead?
Cloning into 'project-portal-scripts'...
plink: unknown option "-p"
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

This happens with all of the repositories on bitbucket.linaro.org because of the use of a custom port number.

Syntax output from plink is below - note that to connect to the specified port requires an upper-case P, not a lower-case p as reported in the unknown option error.

$ plink
Plink: command-line connection utility
Release 0.70
Usage: plink [options] [user@]host [command]
       ("host" can also be a PuTTY saved session name)
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -ssh -telnet -rlogin -raw -serial
            force use of a particular protocol
  -P port   connect to specified port
  -l user   connect with specified username
  -batch    disable all interactive prompts
  -proxycmd command
            use 'command' as local proxy
  -sercfg configuration-string (e.g. 19200,8,n,1,X)
            Specify the serial configuration (serial only)
The following options only apply to SSH connections:
  -pw passw login with specified password
  -D [listen-IP:]listen-port
            Dynamic SOCKS-based port forwarding
  -L [listen-IP:]listen-port:host:port
            Forward local port to remote address
  -R [listen-IP:]listen-port:host:port
            Forward remote port to local address
  -X -x     enable / disable X11 forwarding
  -A -a     enable / disable agent forwarding
  -t -T     enable / disable pty allocation
  -1 -2     force use of particular protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for user authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -hostkey aa:bb:cc:...
            manually specify a host key (may be repeated)
  -m file   read remote command(s) from file
  -s        remote command is an SSH subsystem (SSH-2 only)
  -N        don't start a shell/command (SSH-2 only)
  -nc host:port
            open tunnel in place of session (SSH-2 only)
  -sshlog file
  -sshrawlog file
            log protocol details to a file
  -shareexists
            test whether a connection-sharing upstream exists
@alegrigoriev
Copy link

alegrigoriev commented Jan 13, 2019

Do
git config ssh.variant plink

(See help for git config command for explanation)

@pcolmer
Copy link
Author

pcolmer commented Jan 14, 2019

@alegrigoriev Thanks for that. Given that I picked "Use (Tortoise) plink" on the "Choose the SSH executable" option in the installer, should the installer not be setting this value?

@dscho
Copy link
Member

dscho commented Feb 21, 2019

Given that I picked "Use (Tortoise) plink" on the "Choose the SSH executable" option in the installer, should the installer not be setting this value?

Patches welcome.

The setting would need to be added to this block, I would think, and could make use of the newly-introduced GitSystemConfigSet() function.

To test this:

  1. Download and install Git for Windows' SDK
  2. sdk cd build-extra
  3. edit the file installer/install.iss as indicated above
  4. Build an installer via ./installer/release.sh 0-test
  5. Test
  6. commit with an informative commit message and a "Signed-off-by:" line
  7. Push to your fork
  8. Open a Pull Request.

@webstech
Copy link

Would this also need to ask the user if tortoise plink is being used? The parms are different. How about something like this? ssh.variant would then be set to the appropriate value. I am open to suggestions for an alternate caption. I thought a check box was a little cleaner than three radio buttons but am not a UI designer.

image

@webstech
Copy link

The description could also be changed to let the user know the Git config variable is being set. For example:

image

@rimrul
Copy link
Member

rimrul commented Aug 28, 2019

Is this solved now with 2.23.0? The patch notes sound like it.

@webstech
Copy link

Is this solved now with 2.23.0? The patch notes sound like it.

Yes, it should now be fixed. @pcolmer is the update working for you? The patch is in a different repository that is used as part of the git for windows build (if you are looking for the specific patch).

@pcolmer
Copy link
Author

pcolmer commented Aug 29, 2019

I can confirm that installing 2.23.0 has a much clearer dialogue with regards to the SSH executable. It correctly picked up the PuTTY plink path and did not set the Tortoise option.

Thanks for this update.

@dscho dscho closed this as completed Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@dscho @pcolmer @rimrul @webstech @alegrigoriev and others