From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63112 invoked by alias); 21 Apr 2016 16:35:40 -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 63095 invoked by uid 89); 21 Apr 2016 16:35:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*UA:Bat!, H*x:Bat!, H*r:sk:postmas, H*x:Home X-HELO: smtp.ht-systems.ru Received: from smtp.ht-systems.ru (HELO smtp.ht-systems.ru) (78.110.50.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Apr 2016 16:35:37 +0000 Received: from [95.165.144.62] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) (Authenticated sender: postmaster@rootdir.org) id 1atHZk-0005PC-2D ; Thu, 21 Apr 2016 19:35:32 +0300 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 21 Apr 2016 16:34:15 -0000 Date: Thu, 21 Apr 2016 19:50:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1141103779.20160421193415@yandex.ru> To: Adam Dinwoodie , cygwin@cygwin.com Subject: Re: git and absolute Windows-style paths In-Reply-To: <20160420210526.GL2345@dinwoodie.org> References: <57169662.9060503@gmail.com> <5717A3EF.6030407@gmail.com> <5717A5C6.5060001@cs.umass.edu> <5717E88E.5050404@cs.umass.edu> <20160420210526.GL2345@dinwoodie.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00556.txt.bz2 Greetings, Adam Dinwoodie! > On Wed, Apr 20, 2016 at 04:37:34PM -0400, 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" > For a marginally simpler, or at least shorter, version, use `for n; do > ...` rather than `for n in "$@"; do` -- Bash loops over positional > arguments by default if you don't specify a list with `in`. > Perfect for confusing anyone else (or indeed yourself at some point in > the future) who isn't familiar with the many, many idiosyncrasies of > shell languages. There's no chance you could confuse anyone with this functionality, as it is mandated by POSIX. -- With best regards, Andrey Repin Thursday, April 21, 2016 19:33:42 Sorry for my terrible english... -- 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