public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ernie Rael <err@raelity.com>
To: cygwin@cygwin.com
Subject: Re: git and absolute Windows-style paths
Date: Wed, 20 Apr 2016 18:18:00 -0000	[thread overview]
Message-ID: <5717C76F.1040307@raelity.com> (raw)
In-Reply-To: <BLUPR03MB23017F9B3FCB1DEDA3F7734DF6D0@BLUPR03MB230.namprd03.prod.outlook.com>

On 4/20/2016 9:10 AM, Brian Clifton wrote:
> I agree completely-
>
> Faking out git by wrapping it as a function in your .bashrc would be an ideal approach.  I was the person championing that PR which got rejected, unfortunately. The NPM folks were recommending to use mingw which *is* supported... but I haven't seen any updates to that project since 2013... and I prefer the approach Cygwin takes :)
>
> Eliot, I would be all about taking you up on fixing that psuedo-code example I shared earlier. I have a lot to learn about shell scripting and while I am sure I can figure it out, having help would be extremely appreciated :)
>
> The example I shared in my intro thread:
> #####
> function git {
>      for var in "$@"
>      do
>          if [[ $var == *":\\"* ]]; then
>              $var="$(cygpath $var)" #this doesn't work, but the idea is to do something like this
>          fi
>      done
>      command git "$@"
> }
> #####

This extract from a bash function, using an array assignment, might be 
of interest.

       IFS=$'\n'
       args=($(cygpath -m -- "$@"))
       IFS=$' \t\n'
       gvim "${args[@]}"

> ________________________________________
> From: cygwin-owner@cygwin.com <cygwin-owner@cygwin.com> on behalf of Eliot Moss <moss@cs.umass.edu>
> Sent: Wednesday, April 20, 2016 8:52 AM
> To: cygwin@cygwin.com
> Subject: Re: git and absolute Windows-style paths
>
> On 4/20/2016 11:44 AM, silverwind wrote:
>> Hey,
>>
>>> Does it work if you do:
>>>
>>> git add c:/test/file
>> Nope, won't work either. No file is added, exit code 0 is given.
>>
>>   > I can't immediately see what's going wrong, so I'm going to report this upstream.
>>
>> Thanks. I came upon this issue through npm which is using these Windows paths for certain git
>> operations. Unfortunately, The npm team is very reluctant when it comes to merging Cygwin-specific
>> patches, so chances of landing a fix on their side are rather slim.
>>
>> Is there a public repository for the git package used by Cygwin?
> I think that tackling this with a script/function is a better approach ...
>
> Eliot Moss
>
> --
> 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
>
>
>


--
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-20 18:16 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 [this message]
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
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=5717C76F.1040307@raelity.com \
    --to=err@raelity.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).