Vulcano
Vulcano

Reputation: 435

Visual Studio not executing sub executables within the git commit-message hooks

I've got a local git repository which queries a development server for work items. These items are then parsed and checked if the commit message suits a certain format.

This works fine and within the bash and Source Tree, however Visual Studio won't execute the sub-command to query the server.

How can I persuade VS to execute it? Maybe there is a security switch somewhere?

My current Setup:

An example commit-msg hook

#!/bin/sh
#
hooksDir=$(git config core.hooksPath)

item=$($hooksDir/curl http://www.dict.cc/)
echo ${#item}
exit 1;

The output of the bash

C:\projects\Hooks\clienthooks>git commit -am "foo"
% Total    % Received % Xferd  Average Speed   Time    Time     Time  
Current
                             Dload  Upload   Total   Spent    Left  Speed
100 40126  100 40126    0     0   502k      0 --:--:-- --:--:-- --:--:--  502k
40126

The output of sourcetree:

0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 39795  100 39795    0     0   498k      0 --:--:-- --:--:-- --:--:--  
498k
39795
Completed with errors, see above.

The output of visual studio:

Git process failed unexpectedly.
0

Upvotes: 1

Views: 331

Answers (1)

Vulcano
Vulcano

Reputation: 435

If anyone stumbles upon this question: It seems curl is the problem and for whatever reason VS2017 doesn't fire up curl.

But it fires up every other executable I tested so: I've circumvented the problem by writing a new project in C#. Then I fire the executable and check for the output within the bash.

Upvotes: 1

Related Questions