git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Silent failure to add Windows-style paths in Cygwin Git

From
Adam Dinwoodie <adam@dinwoodie.org>
Date
Apr 20, 2016, 09:17 UTC
Message-ID
<20160420091747.GH2345@dinwoodie.org>

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
Message 1 of 1 in “Silent failure to add Windows-style paths in Cygwin Git”
  1. Adam DinwoodieApr 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.