delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/04/21/12:35:58

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=AvizwofXNrGPs4+q
1juEcsMPe/xkiU+gqM7hWsjw6P7UJEmLZjb9aojfI6HxvJ2YYlZ19cO0oTjipYKf
X5BAtQb+NaXcHCass2oClujoHpEyCaqdkUsAo6i+MLF8zrkQkKDyfT15+2Nr+mRw
QqjzFvuYGdtJIiSiOVu/o9OFrhk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=W+yWNTxxJcA0Dj1pGpO+FN
Se3XQ=; b=VilxHYw5PFyEYTzA6Wh2bFRC5IscgcZcQ12yVmai7P2ed9gNu+WOcc
yDkRvL2mAPY9+y0KPw2dhPhjDFR0w+w0OwF+EWxm93yE+Y0NXZUmmasqEzj1UZKU
uhNOp5fOEQCxJ4IKb+FvdlGkzRo/tq6ZQ+GDUhxQzA07V3zejZQSk=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Thu, 21 Apr 2016 19:34:15 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <1141103779.20160421193415@yandex.ru>
To: Adam Dinwoodie <adam AT dinwoodie DOT org>, cygwin AT cygwin DOT com
Subject: Re: git and absolute Windows-style paths
In-Reply-To: <20160420210526.GL2345@dinwoodie.org>
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> <5717E88E DOT 5050404 AT cs DOT umass DOT edu> <20160420210526 DOT GL2345 AT dinwoodie DOT org>
MIME-Version: 1.0
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019