Having a problem reading a user input in SourceTree from precommit shell script hook

Amit Tare December 10, 2017

I am using SourceTree 1.6. We are using precommit shell script GIT hook. In the hook we are asking the developer to input a value from keyboard and then that value is captured in a variable and used further. When I do a commit using 'git commit' command from GIT Bash Tool it stops for the user input , after the user enters the value the script is completed successfully. But when we do a commit from SourceTree, it seems the script waits for the input but I don't see the place where to provide the input. Can you please help ?

 

My script is something like this:

#!/bin/sh

exec < /dev/tty

read -p 'path : ' user_entry
echo $user_entry

exit 0

1 answer

0 votes
bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 11, 2017

Hi Amit,

SourceTree 1.6 is no longer a supported version; it's available for download only for those that need it as a fallback for a specific reason. That said, interactive scripting triggered by commits isn't supported within the Sourcetree UI.

Brian Ganninger
Senior Mac Developer, Sourcetree

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events