This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: git and absolute Windows-style paths
- From: Ernie Rael <err at raelity dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 20 Apr 2016 11:16:15 -0700
- 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>
On 4/20/2016 9:10 AM, Brian Clifton wrote:
I agree completely-
Faking out git by wrapping it as a function in your .bashrc would be an ideal approach. I was the person championing that PR which got rejected, unfortunately. The NPM folks were recommending to use mingw which *is* supported... but I haven't seen any updates to that project since 2013... and I prefer the approach Cygwin takes :)
Eliot, I would be all about taking you up on fixing that psuedo-code example I shared earlier. I have a lot to learn about shell scripting and while I am sure I can figure it out, having help would be extremely appreciated :)
The example I shared in my intro thread:
#####
function git {
for var in "$@"
do
if [[ $var == *":\\"* ]]; then
$var="$(cygpath $var)" #this doesn't work, but the idea is to do something like this
fi
done
command git "$@"
}
#####
This extract from a bash function, using an array assignment, might be
of interest.
IFS=$'\n'
args=($(cygpath -m -- "$@"))
IFS=$' \t\n'
gvim "${args[@]}"
________________________________________
From: cygwin-owner@cygwin.com <cygwin-owner@cygwin.com> on behalf of Eliot Moss <moss@cs.umass.edu>
Sent: Wednesday, April 20, 2016 8:52 AM
To: cygwin@cygwin.com
Subject: Re: git and absolute Windows-style paths
On 4/20/2016 11:44 AM, silverwind wrote:
Hey,
Does it work if you do:
git add c:/test/file
Nope, won't work either. No file is added, exit code 0 is given.
> I can't immediately see what's going wrong, so I'm going to report this upstream.
Thanks. I came upon this issue through npm which is using these Windows paths for certain git
operations. Unfortunately, The npm team is very reluctant when it comes to merging Cygwin-specific
patches, so chances of landing a fix on their side are rather slim.
Is there a public repository for the git package used by Cygwin?
I think that tackling this with a script/function is a better approach ...
Eliot Moss
--
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
--
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
--
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