This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: git and absolute Windows-style paths
- From: Eliot Moss <moss at cs dot umass dot edu>
- To: cygwin at cygwin dot com
- Date: Wed, 20 Apr 2016 16:37:34 -0400
- Subject: Re: git and absolute Windows-style paths
- Authentication-results: sourceware.org; auth=none
- References: <57169662 dot 9060503 at gmail dot com> <e8b47924c6ff4f07993627dbb26f7066 at ntmaexbe04 dot bedford dot progress dot com> <5717A3EF dot 6030407 at gmail dot com> <5717A5C6 dot 5060001 at cs dot umass dot edu> <BLUPR03MB23017F9B3FCB1DEDA3F7734DF6D0 at BLUPR03MB230 dot namprd03 dot prod dot outlook dot com>
- Reply-to: moss at cs dot umass dot edu
I think this will do it:
function git {
declare -a ARGS
for n in "$@" ; do ARGS+=("$(cygpath -u -- "${n}")") ; done
command git "${ARGS[@]}"
}
The reason this is a little more complicated than some other approaches
might be is that it will also work for arguments that have space, e.g.,
git add "C:/My Documents/foo.doc"
Regards -- Eliot
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple