From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53447 invoked by alias); 21 Apr 2016 15:19:31 -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 53373 invoked by uid 89); 21 Apr 2016 15:19:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=U*mingw.android, sk:mingw.a, sk:mingwa, mingwandroidgmailcom X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 21 Apr 2016 15:19:20 +0000 Received: by mail-wm0-f54.google.com with SMTP id u206so138239774wme.1 for ; Thu, 21 Apr 2016 08:19:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=EVNja1gvVUo2dkAWtyujsjQA/my8HwHT7PDw7bg3+fA=; b=h8HHayLbrHrjgRue8/he2cOEQ5tFClUnxPfKyYx56o/YJHnGhNsrJtY00rQM/Elv9V /VeK8Ij3hGUObL40zY6qlwkvu1eUhb4LV2q+8FK/Wksb9rlm15sdO31Rhtp07b8pXEnr xqKe+TFDD3azNj/49wHJx6cecRbmxQxIN2HkQnXvULuMFUW5N2CmPQj9w5/DLxdw2FZU r7uWwbQ+QIv/3eG4bB93kx59+2mC06vCJ5vy22zBRmG6z1E7JsYjLrhnUGjmbS6svat5 ML59q6VTEgW4Lom7E/J+vH6mmsgLtA7htLCJOxuBQn+3aekk4SK/1xMqFTdYbHC/5Kvl bTNA== X-Gm-Message-State: AOPr4FVzBlZmGtKH+XVlYAAUnvkVIYB9jy/SF/c2MB3rHr9htzVyp0fiX1NVl1aed4WeAVj2zfVSiSCvUEHt+w== MIME-Version: 1.0 X-Received: by 10.194.58.138 with SMTP id r10mr14851221wjq.153.1461251957134; Thu, 21 Apr 2016 08:19:17 -0700 (PDT) Received: by 10.194.24.199 with HTTP; Thu, 21 Apr 2016 08:19:17 -0700 (PDT) In-Reply-To: References: <57169662.9060503@gmail.com> <5717A3EF.6030407@gmail.com> <5717A5C6.5060001@cs.umass.edu> <5717E88E.5050404@cs.umass.edu> <57180D5A.8020300@raelity.com> <57181360.2090408@cs.umass.edu> Date: Thu, 21 Apr 2016 16:01:00 -0000 Message-ID: Subject: Re: git and absolute Windows-style paths From: Ray Donnelly To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00553.txt.bz2 On Thu, Apr 21, 2016 at 2:11 PM, Ray Donnelly wrote: > Here's a patch for git 2.8.1 that I wrote for MSYS2 to address the > same issue. Because I'd read this thread before I started working on > it (and generally since it's good to) I kept it in mind to make it > work for Cygwin in-case you wanted to use it: > > https://raw.githubusercontent.com/Alexpux/MSYS2-packages/6b7aceea4ad2e5bd28143a2de8c4a0d7453013dc/git/git-2.8.1-Cygwin-Allow-DOS-paths.patch > > I'm running the test-suite now which takes an age, but I don't see any > problems with it so far. I didn't add any tests covering using DOS > paths though. I've tested it with git add and clone with DOS relative > and absolute paths. FYI, the test results were the same before and after this patch. > > Best regards, > > Ray. > > On Thu, Apr 21, 2016 at 12:40 AM, Eliot Moss wrote: >> On 4/20/2016 7:14 PM, Ernie Rael wrote: >>> >>> 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. >> >> >> Ok ... but I would save the previous value of IFS and restore it -- never >> know what a user might be using there ... >> >> Best -- E >> >> >> -- >> 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