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

Sparse checkout not working as expected (colons in filenames on Windows)

From
Philip Oakley <philipoakley@iee.org>
Date
Mar 19, 2015, 23:03 UTC
Message-ID
<BE2660C974C9415E997F20A49ABC766E@PhilipOakley>

Hi, I was expecting that sparse checkout could be used to avoid the checking out, by git, of files which have colons in their name into the worktree when on Windows.

Yue Lin Ho reported on the Msygit list [1] that he had a repo where there was already committed a file with a colon in it's name, which was a needed file and had been committed by a Linux user. The problem was how to work with that repo on a Windows box where such a file is prohibited to exist on the FS (hence the expectation that a sparse checkout would suffice). Yue has created a short test repo [2]

Even after getting the pathspec escaping right, I still haven't been able to make this expected behaviour work [3].

Am I wrong to expect that sparse checkout (and the skip-worktree bit) can be used to avoid files with undesirable filenames hitting the OS's file system?

If it should be OK, what's the correct recipe?

-- Philip

[1] https://groups.google.com/forum/?hl=en_US?hl%3Den#!topic/msysgit/D4HcHRpxPgU "How to play around with the filename with colon on Windows?" [2] Test repo https://github.com/t-pascal/tortoisegit-colons

[3] test sequence:: $ mkdir colons && cd colons $ git clone -n https://github.com/t-pascal/tortoisegit-colons $ cd tortoisegit-colons/ $ git config core.sparseCheckout true $ cat .git/info/sparse-checkout # external editor /* !ifcfg-eth0\:0 $ git update-index --skip-worktree -- ifcfg-eth0\:0 Ignoring path ifcfg-eth0:0 $ git checkout -b test 7f35d34bc6160cc # tip commit, we are still unborn! error: Invalid path 'ifcfg-eth0:0 D ifcfg-eth0:0 Switched to a new branch 'test'

Next: Duy Nguyen
Message 1 of 7 in “Sparse checkout not working as expected (colons in filenames on Windows)”
  1. Philip OakleyMar 19, 2015
  2. Duy NguyenMar 24, 2015
  3. Philip OakleyMar 24, 2015
  4. Duy NguyenMar 25, 2015
  5. Johannes SchindelinMar 25, 2015
  6. Duy NguyenMar 25, 2015
  7. Johannes SchindelinMar 25, 2015

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.