1

I'm trying to call TFSBuild from the Git Bash shell but I'm not having any luck.

Using

"$TFSBUILD" start //Collection:http://tfsserver

converts the second argument to

//Collection:http://tfsserver

so the argument will not work because it has two slashes at the start.

Using

"$TFSBUILD" start /Collection:http://tfsserver

converts the second argument to

/Collection:http:/tfsserver

so the command will not work because a slash has been removed from the URL.

It looks like for the first option, MSYS Bash thinks the path is a UNC path, so it's not removing the first slash:

An argument starting with 2 or more / is considered an escaped Windows style switch and will be passed with the leading / removed and all \ changed to /. Except that if there is a / following the leading block of /, the argument is considered to be a UNC path and the leading / is not removed.

Is there any workaround or any way to turn off this behavior? I've tried all sorts of combinations of quotes, running on cmd /c instead, using variables, and nothing has worked yet.

4
  • MSYS is not MinGW. And technically, you can't be sure MSYS is the same as the MSYSgit shell, or the MSYS2 shell. Have you tried the latter? It is more up to date with respect to the Cygwin base, and the packages it comes with.
    – rubenvb
    Commented Oct 3, 2014 at 19:50
  • I'm making a tool for my whole team and I need this to work in the standard Git Bash shell. Commented Oct 3, 2014 at 20:47
  • I'm not sure what's standard about msysGit's bash shell, FWIW, it's based on a really old and buggy fork of Cygwin. Commented Oct 8, 2014 at 21:44
  • Thanks, I implemented the solution in PowerShell instead. Commented Oct 8, 2014 at 21:49

1 Answer 1

2

On MSYS2 you can do:

export MSYS2_ARG_CONV_EXCL="//Collection" "$TFSBUILD" start //Collection:http://tfsserver

.. MSYS2_ARG_CONV_EXCL is a semi-colon separated env. var that MSYS2 compares each part of with the front of each argument. If there's a match then that argument is not converted. msysGit doesn't have this feature/pragmatic hack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.