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

git-bugreport-2021-01-06-1209.txt (git can't deal with special characters)

From
DTDaniel Troger <random_n0body@icloud.com>
Date
Jan 6, 2021, 11:35 UTC
Message-ID
<A102844A-9501-4A86-854D-E3B387D378AA@icloud.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue) I ran `git restore -p .`

What did you expect to happen? (Expected behavior) git restore to open in interactive mode and letting me select data to discard

What happened instead? (Actual behavior)
I got an error message:
```
me@iMac:[redacted]/paulbrunngård-springyard/src$ git restore -p .
BUG: pathspec.c:495: error initializing pathspec_item
Cannot close git diff-index --cached --numstat --summary HEAD -- :(,prefix:44)[redacted]/paulbrunngård-springyard/src/ () at /usr/local/Cellar/git/2.29.2/libexec/git-core/git-add--interactive line 183.
```

What's different between what you expected and what actually happened? The main problem is that the command didn't do anything. It basically printed an error message instead of changing a file in the way I wanted.

Anything else you want to add: Yeah. So pretty obviously the problem is the "å" in the filename. The interesting thing is that the folder with the "å" in the filename seems to exist twice, with differently encoded "å"s. But their content IS AUTOMATICALLY PERFECTLY SYNCED. And the only tool which recognizes them as two different folders is git. ls in the terminal shows them as one, finder shows them as one, even "glob" in php shows them as one. This is what git seems to see them at (taken from git status):

`modified:   "paulbrunnga\314\212rd-springyard/`
And further down:
```
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	"paulbrunng\303\245rd-springyard/"
```
Here is a zip containing the folder (emptied): https://arxius.io/f/7ec7e1c7
I tried creating a new git repo, extracting the zip in it, going into the folder and running `git add empty` and could reproduce that git sees it as two different folders.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.29.2 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Darwin 17.7.0 Darwin Kernel Version 17.7.0: Sun Jun 2 20:31:42 PDT 2019; root:xnu-4570.71.46~1/RELEASE_X86_64 x86_64 compiler info: clang: 10.0.0 (clang-1000.11.45.5) libc info: no libc information available $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]
Next: Torsten Bögershausen
Message 1 of 22 in “git-bugreport-2021-01-06-1209.txt (git can't deal with special characters)”
  1. Daniel TrogerJan 6, 2021
  2. Torsten BögershausenJan 6, 2021
  3. Daniel TrogerJan 6, 2021
  4. Torsten BögershausenJan 6, 2021
  5. Daniel TrogerJan 6, 2021
  6. Randall S. BeckerJan 6, 2021
  7. Philippe BlainJan 7, 2021
  8. Torsten BögershausenJan 7, 2021
  9. Philippe BlainJan 7, 2021
  10. Torsten BögershausenJan 8, 2021
  11. 1/1 git restore -p . and precomposed unicodetboegi@web.de, Jan 24, 2021
  12. Junio C HamanoJan 24, 2021
  13. Torsten BögershausenJan 25, 2021
  14. 1/1 MacOS: precompose_argv_prefix()tboegi@web.de, Jan 29, 2021
  15. Junio C HamanoJan 29, 2021
  16. Junio C HamanoJan 31, 2021
  17. 1/1 MacOS: precompose_argv_prefix()tboegi@web.de, Feb 2, 2021
  18. Junio C HamanoFeb 2, 2021
  19. 1/1 MacOS: precompose_argv_prefix()tboegi@web.de, Feb 3, 2021
  20. Junio C HamanoFeb 3, 2021
  21. Junio C HamanoFeb 3, 2021
  22. Torsten BögershausenFeb 5, 2021

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.