PDA

View Full Version : Qt Creator Cannot push to GitHub from Qt Creator because of ssh-askpass or AppleScript issue



Obson
6th September 2017, 22:15
I am attempting to push to a remote GitHub repository using Tools > Git > Remote repository > push. This works perfectly from my MacOS Sierra Desktop but fails from my MacBook Sierra (version 10.12.6 -- I don't have access to the desktop version number at the moment). Initially it seemed that the problem was caused by the absence of an ssh-askpass script but I fixed this following the instructions at https://github.com/markcarver/mac-ssh-askpass and https://apple.stackexchange.com/questions/208478/how-do-i-disable-system-integrity-protection-sip-aka-rootless-on-os-x-10-11/208481.

The appleScript code I'm using for ssh-askpass is



#!/bin/bash
# Script: ssh-askpass
# Author: Mark Carver
# Created: 2011-09-14
# Licensed under GPL 3.0

# A ssh-askpass command for Mac OS X
# Based from author: Joseph Mocker, Sun Microsystems
# http://blogs.oracle.com/mock/entry/and_now_chicken_of_the

# To use this script:
# Install this script running INSTALL as root
#
# If you plan on manually installing this script, please note that you will have
# to set the following variable for SSH to recognize where the script is located:
# export SSH_ASKPASS="/path/to/ssh-askpass"

TITLE="${SSH_ASKPASS_TITLE:-SSH}";
TEXT="$(whoami)'s password:";
IFS=$(printf "\n");
CODE=("on GetCurrentApp()");
CODE=(${CODE } "tell application \"System Events\" to get short name of first process whose frontmost is true");
CODE=(${CODE } "end GetCurrentApp");
CODE=(${CODE } "tell application GetCurrentApp()");
CODE=(${CODE } "activate");
CODE=(${CODE } "display dialog \"${@:-$TEXT}\" default answer \"\" with title \"${TITLE}\" with icon caution with hidden answer");
CODE=(${CODE } "text returned of result");
CODE=(${CODE } "end tell");
SCRIPT="/usr/bin/osascript"
for LINE in ${CODE }; do
SCRIPT="${SCRIPT} -e $(printf "%q" "${LINE}")";
done;
eval "${SCRIPT}";


I set the path to ssh-askpass in Qt Creator > Preferences > Version control, set the permissions to executable, and checked it from the command line. As expected it brought up a dialog requesting a password, and correctly returned the entered password when OK'ed. However, when invoked from the Qt menu it fails with the following output:



129:328: execution error: Can’t get application missing value of «script». (-1728)
error: unable to read askpass response from '/usr/libexec/ssh-askpass'
fatal: could not read Username for 'https://github.com': Device not configured
The command "/usr/bin/git" terminated with exit code 128.


I am fairly new to MacOS and have no familiarity (so far) with AppleScript, and would be very grateful for any guidance on how to fix this issue. I realise I could set things up to use SSH from the command line, but I would really like to use the built-in mechanism if possible.