From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10221 invoked by alias); 20 Apr 2016 23:14:51 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 10204 invoked by uid 89); 20 Apr 2016 23:14:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=ifs, IFS, ernie, Documents X-HELO: resqmta-po-02v.sys.comcast.net Received: from resqmta-po-02v.sys.comcast.net (HELO resqmta-po-02v.sys.comcast.net) (96.114.154.161) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 20 Apr 2016 23:14:40 +0000 Received: from resomta-po-12v.sys.comcast.net ([96.114.154.236]) by comcast with SMTP id t1K3aI8EHGhQ0t1KQa8lRG; Wed, 20 Apr 2016 23:14:38 +0000 Received: from [IPv6:::1] ([IPv6:2601:646:8f00:d2:6449:4ba2:1637:7655]) by resomta-po-12v.sys.comcast.net with comcast id knEd1s00N0V4Xdw01nEdy0; Wed, 20 Apr 2016 23:14:37 +0000 Subject: Re: git and absolute Windows-style paths To: cygwin@cygwin.com References: <57169662.9060503@gmail.com> <5717A3EF.6030407@gmail.com> <5717A5C6.5060001@cs.umass.edu> <5717E88E.5050404@cs.umass.edu> From: Ernie Rael Message-ID: <57180D5A.8020300@raelity.com> Date: Wed, 20 Apr 2016 23:40:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5717E88E.5050404@cs.umass.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00540.txt.bz2 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