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

[BUG] git filter-branch failed to suppress a file with an accentuated letter in the filename

From
Remi Vanicat <vanicat@debian.org>
Date
Feb 15, 2008, 16:56 UTC
Message-ID
<87bq6iw42w.dlv@maison.homelinux.org>

git filter-branch --tree-filter has a problem with filename with accentuated letter:

$ git add foo/baré
$ git commit -m "adding a file with an accent"
Created initial commit b27ae97: adding a file with an accent
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 "foo/bar\303\251"
$ git filter-branch --tree-filter "rm -rf foo"
Rewrite b27ae977459379e4e7eee1a3d523f908903ea6ae (1/1)
WARNING: Ref 'refs/heads/master' is unchanged

there the foo/baré file still exists, but: $ git filter-branch --tree-filter "rm -rf foo; git add -u" will suppress the said file from history.

The culprit seem to be those line of filter-branch: (around line 279) 
		git diff-index -r $commit | cut -f 2- | tr '\012' '\000' | \
			xargs -0 git update-index --add --replace --remove
git diff-index giving the filename as "foo/bar\303\251"
-- 
Rémi Vanicat
Next: Junio C Hamano
Message 1 of 9 in “[BUG] git filter-branch failed to suppress a file with an accentuated letter in the filename”
  1. Remi VanicatFeb 15, 2008
  2. Junio C HamanoFeb 15, 2008
  3. Johannes SchindelinFeb 15, 2008
  4. Junio C HamanoFeb 15, 2008
  5. Johannes SchindelinFeb 16, 2008
  6. Johannes SchindelinFeb 16, 2008
  7. Remi VanicatFeb 16, 2008
  8. Junio C HamanoFeb 16, 2008
  9. Remi VanicatFeb 16, 2008

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.