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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=hSU1/5gKk2wRuNdG S1pRAsK4D9eXStyjDK+F88nQKMnRJiGxL4zij+WbLdpKoUhHmtvMrY4Yu9oLeeEu xBgY8Ar6yzGgDsSZJHWtELqdfA4DDtqHJwmrg0MoyTheKLCBW8FgmzcKU5cQfwPB TXIMn4QOZxZQ4aSEUOLSofilZOI= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=nxTJzmASwncWyjojx/qu5d kucZ8=; b=kAUqjblmyMa3nJIjvL6wK8N7oYIfbn6rpJ1/zGfLjUG13F5xbyjeKc yAOP20ytXcsbcr3D1O74csTe5BRH9jOO4qEJq5H7ZzudCnCaXQGCcaSc7qBOF7pB 90vUlv267aFFbckXoGb71Lg32gOjerZYt3OmzBjBPvzgc0410DGyM= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-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 Subject: Re: git and absolute Windows-style paths To: cygwin AT cygwin DOT com References: <57169662 DOT 9060503 AT gmail DOT com> <5717A3EF DOT 6030407 AT gmail DOT com> <5717A5C6 DOT 5060001 AT cs DOT umass DOT edu> <5717E88E DOT 5050404 AT cs DOT umass DOT edu> From: Ernie Rael Message-ID: <57180D5A.8020300@raelity.com> Date: Wed, 20 Apr 2016 16:14:34 -0700 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 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