From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47967 invoked by alias); 21 Apr 2016 13:11:24 -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 43206 invoked by uid 89); 21 Apr 2016 13:11:20 -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=DOS, H*i:sk:5718136, H*f:sk:5718136, age 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 13:11:08 +0000 Received: by mail-wm0-f54.google.com with SMTP id v188so244130180wme.1 for ; Thu, 21 Apr 2016 06:11:08 -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=O4nmXtHaT3UHWAGFQTnZOKfeOwiLI3z90fpZgAEB2c4=; b=hbQIwewidXbeAC/Css27NosjS1pCA5C/PbyeJfH0+Ls+RseH4MFjNxinPolzsdTD5h 0sV8yXKp3YvgNMU4UE6rNwrIG+ltb4fS1RHK8nFENj6iLAm+VpObVXBauhkiAmgTrhOo lmJ6XjgNogsF3joXqzQntzexIWEgxojYxozm/oAau82XuqDR93HEhUnx6jDWQjOaQ3X+ caHPoV1c/rW8ARLfxvw+cTyAAB8ZEw5WPS9YJs4TmappqmY5WpniK/j+klUwkXzNjfdL sNFzHbCxx1WSS+fWajpY9BcWdbFGtABXu7b9kr5JCBOuMuiXu5ySKtQpk2DidTsuAYH5 T6nA== X-Gm-Message-State: AOPr4FXknc4OoJxVamtE2LYqLvcHFkCza9yLqc6HhXQLlPc48dIa6IZTfh4jK4uuKyQIyJfLh8RzXHPUIQHIFQ== MIME-Version: 1.0 X-Received: by 10.28.129.209 with SMTP id c200mr10522570wmd.38.1461244265811; Thu, 21 Apr 2016 06:11:05 -0700 (PDT) Received: by 10.194.24.199 with HTTP; Thu, 21 Apr 2016 06:11:05 -0700 (PDT) In-Reply-To: <57181360.2090408@cs.umass.edu> 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 15:19: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/msg00552.txt.bz2 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. 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