# Silent failure to add Windows-style paths in Cygwin Git

2 messages from 2016-04-25 to 2016-04-25. Participants: Adam Dinwoodie, Duy Nguyen.
Thread: https://gitlist.dev/t/42137

## Adam Dinwoodie, 2016-04-25 12:07

Subject: Silent failure to add Windows-style paths in Cygwin Git
Message-ID: <20160425120705.GN2345@dinwoodie.org>
URL: https://gitlist.dev/e/20160425120705.GN2345%40dinwoodie.org

```
[Resending as my initial attempt appears to have not made it to the
list.  Apologies if this results in a double-post.]

If I attempt to `git add` an extant file specified using a Windows-style
path on Cygwin Git, this doesn't add the file, and produces no error
message:

    $ pwd  # As seen by Cygwin
    /cygdrive/c/tmp

    $ cygpath -aw .  # As seen by Windows
    C:\tmp

    $ git init
    Initialized empty Git repository in /cygdrive/c/tmp/.git/

    $ git add 'c:\tmp\file' || echo non-zero exit code  # Errors out as expected
    fatal: pathspec 'c:\tmp\file' did not match any files
    non-zero exit code

    $ touch file

    $ git add 'c:\tmp\file' || echo non-zero exit code  # No error this time...

    $ git status  # ...even though the file didn't get added
    On branch master

    Initial commit

    Untracked files:
      (use "git add <file>..." to include in what will be committed)

            file

    nothing added to commit but untracked files present (use "git add" to track)

I wouldn't expect adding the file to actually succeed, but I would
expect it to either succeed or produce an error, rather than silently
failing.

Experimentation shows I get the same behaviour for 'c:\tmp\file',
'c:/tmp/file' and 'subdir\file'.  I'm seeing this on v2.8.0; the
downstream report says the same behaviour occurs on v2.7.4[0], and I've
also seen what appears to be the same behaviour on a v2.0.5 build I
produced to check.

Adam

[0]: https://cygwin.com/ml/cygwin/2016-04/msg00474.html

```

## Duy Nguyen, 2016-04-25 12:18

Subject: Re: Silent failure to add Windows-style paths in Cygwin Git
Message-ID: <CACsJy8CDbfKWYdXg1WtcCeZMGV2OwjgBzBgj56h87hes5Dom4g@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8CDbfKWYdXg1WtcCeZMGV2OwjgBzBgj56h87hes5Dom4g%40mail.gmail.com
In-Reply-To: <20160425120705.GN2345@dinwoodie.org>

```
On Mon, Apr 25, 2016 at 7:07 PM, Adam Dinwoodie <adam@dinwoodie.org> wrote:
> [Resending as my initial attempt appears to have not made it to the
> list.  Apologies if this results in a double-post.]
>
> If I attempt to `git add` an extant file specified using a Windows-style
> path on Cygwin Git, this doesn't add the file, and produces no error
> message:
>
>     ...
>
> I wouldn't expect adding the file to actually succeed, but I would
> expect it to either succeed or produce an error, rather than silently
> failing.
>
> Experimentation shows I get the same behaviour for 'c:\tmp\file',
> 'c:/tmp/file' and 'subdir\file'.  I'm seeing this on v2.8.0; the
> downstream report says the same behaviour occurs on v2.7.4[0], and I've
> also seen what appears to be the same behaviour on a v2.0.5 build I
> produced to check.

Can you try git-bisect if possible? An strace log may be helpful
otherwise (looks like strace is supported on cygwin, but I don't know
to what level)
-- 
Duy

```
