I edit a file called files/en-us/glossary/bézier_curve/index.html and then type git status and I get this:

▶ git status
...
Changes not staged for commit:
  ...
    modified:   "files/en-us/glossary/b\303\251zier_curve/index.html"

...

What's that?! First of all, I actually had this wrapped in a Python script that uses GitPython to analyze the output of for change in repo.index.diff(None):. So I got...

FileNotFoundError: [Errno 2] No such file or directory: '"files/en-us/glossary/b\\303\\251zier_curve/index.html"'

What's that?!

At first, I thought it was something wrong with how I use GitPython and thought I could force some sort of conversion to UTF-8 with Python. That, and to strip the quotation parts with something like path = path[1:-1] if path.startwith('"') else path

After much googling and experimentation, what totally solved all my problems was to run:

▶ git config --global core.quotePath false

Now you get...:

▶ git status
...
Changes not staged for commit:
  ...
    modified:   files/en-us/glossary/bézier_curve/index.html

...

And that also means it works perfectly fine with any GitPython code that does something with the repo.index.diff(None) or repo.index.diff(repo.head.commit).

Also, we I use the git-diff-action GitHub Action which would fail to spot files that contained umlauts but now I run this:


    steps:
       - uses: actions/checkout@v2
+
+      - name: Config git core.quotePath
+        run: git config --global core.quotePath false
+
       - uses: technote-space/get-diff-action@v4.0.6
         id: git_diff_content
         with:

Comments

Your email will never ever be published.

Previous:
In JavaScript (Node) which is fastest, generator function or a big array function? March 5, 2021 Node, JavaScript
Next:
How to simulate slow lazy chunk-loading in React March 25, 2021 React, JavaScript
Related by category:
How I run standalone Python in 2025 January 14, 2025 Python
fnm is much faster than nvm. December 28, 2023 macOS
get in JavaScript is the same as property in Python February 13, 2025 Python
How to resolve a git conflict in poetry.lock February 7, 2020 Python
Related by keyword:
How to resolve a git conflict in poetry.lock February 7, 2020 Python
How to get all of MDN Web Docs running locally June 9, 2021 Web development, MDN
Gcm - git checkout master or main December 21, 2020 Python
.git/info/exclude, .gitignore and ~/.gitignore_global April 20, 2016 Linux, macOS