public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ray Donnelly <mingw.android@gmail.com>
To: cygwin@cygwin.com
Subject: Re: git and absolute Windows-style paths
Date: Thu, 21 Apr 2016 15:19:00 -0000	[thread overview]
Message-ID: <CAOYw7dtdK0pmGSggbF8o+Ng7r-dYvsZPgxvTT5yRKRuqDR+xsA@mail.gmail.com> (raw)
In-Reply-To: <57181360.2090408@cs.umass.edu>

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 <moss@cs.umass.edu> 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

  reply	other threads:[~2016-04-21 13:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 21:00 silverwind
2016-04-19 21:58 ` Marco Atzeri
2016-04-19 22:28   ` Ken Brown
2016-04-20 10:28     ` Adam Dinwoodie
2016-04-20  0:49 ` Bill Smith
2016-04-20 15:52   ` silverwind
2016-04-20 16:06     ` Eliot Moss
2016-04-20 16:15       ` Brian Clifton
2016-04-20 18:18         ` Ernie Rael
2016-04-20 20:39         ` Eliot Moss
2016-04-20 21:17           ` Adam Dinwoodie
2016-04-21 19:50             ` Andrey Repin
2016-04-20 23:40           ` Ernie Rael
2016-04-21  0:14             ` Eliot Moss
2016-04-21 15:19               ` Ray Donnelly [this message]
2016-04-21 16:01                 ` Ray Donnelly
2016-04-20 16:46       ` silverwind
2016-04-20 16:56         ` Adam Dinwoodie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOYw7dtdK0pmGSggbF8o+Ng7r-dYvsZPgxvTT5yRKRuqDR+xsA@mail.gmail.com \
    --to=mingw.android@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).