From: Ernie Rael <err@raelity.com>
To: cygwin@cygwin.com
Subject: Re: git and absolute Windows-style paths
Date: Wed, 20 Apr 2016 23:40:00 -0000 [thread overview]
Message-ID: <57180D5A.8020300@raelity.com> (raw)
In-Reply-To: <5717E88E.5050404@cs.umass.edu>
On 4/20/2016 1:37 PM, Eliot Moss wrote:
> 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"
Notice that
IFS=$'\n'; args=($(cygpath -m -- "$@")); IFS=$' \t\n'
also handles arguments with spaces. You don't need the shell for loop.
-ernie
>
> 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
>
>
>
--
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
next prev parent reply other threads:[~2016-04-20 23:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 21:00 silverwind
2016-04-19 21:58 ` Marco Atzeri
2016-04-19 22:28 ` Ken Brown
2016-04-20 10:28 ` Adam Dinwoodie
2016-04-20 0:49 ` Bill Smith
2016-04-20 15:52 ` silverwind
2016-04-20 16:06 ` Eliot Moss
2016-04-20 16:15 ` Brian Clifton
2016-04-20 18:18 ` Ernie Rael
2016-04-20 20:39 ` Eliot Moss
2016-04-20 21:17 ` Adam Dinwoodie
2016-04-21 19:50 ` Andrey Repin
2016-04-20 23:40 ` Ernie Rael [this message]
2016-04-21 0:14 ` Eliot Moss
2016-04-21 15:19 ` Ray Donnelly
2016-04-21 16:01 ` Ray Donnelly
2016-04-20 16:46 ` silverwind
2016-04-20 16:56 ` Adam Dinwoodie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57180D5A.8020300@raelity.com \
--to=err@raelity.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).