Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Remi Vanicat <vanicat@debian.org>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [BUG] git filter-branch failed to suppress a file with an accentuated letter in the filename
Date: Fri, 15 Feb 2008 23:54:47 -0800	[thread overview]
Message-ID: <7v63wpcp4o.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <87tzk9tnnu.dlv@maison.homelinux.org> (Remi Vanicat's message of "Sat, 16 Feb 2008 07:34:29 +0100")

Not just those two lines but the next two lines were also very
old fashioned.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * Could you try this one?

 git-filter-branch.sh     |    9 +++++----
 t/t7003-filter-branch.sh |   14 ++++++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index ff716ca..49e13f0 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -276,10 +276,11 @@ while read commit parents; do
 		eval "$filter_tree" < /dev/null ||
 			die "tree filter failed: $filter_tree"
 
-		git diff-index -r $commit | cut -f 2- | tr '\012' '\000' | \
-			xargs -0 git update-index --add --replace --remove
-		git ls-files -z --others | \
-			xargs -0 git update-index --add --replace --remove
+		(
+			git diff-index -r --name-only $commit
+			git ls-files --others
+		) |
+		git update-index --add --replace --remove --stdin
 	fi
 
 	eval "$filter_index" < /dev/null ||
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 5f60b22..868babc 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -165,4 +165,18 @@ test_expect_success '"map" works in commit filter' '
 	git rev-parse --verify master
 '
 
+test_expect_success 'Name needing quotes' '
+
+	git checkout -b rerere A &&
+	mkdir foo &&
+	name="れれれ" &&
+	>foo/$name &&
+	git add foo &&
+	git commit -m "Adding a file" &&
+	git filter-branch --tree-filter "rm -fr foo" &&
+	! git ls-files --error-unmatch "foo/$name" &&
+	test $(git rev-parse --verify rerere) != $(git rev-parse --verify A)
+
+'
+
 test_done

  reply	other threads:[~2008-02-16  7:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15 16:56 [BUG] git filter-branch failed to suppress a file with an accentuated letter in the filename Remi Vanicat
2008-02-15 17:50 ` Junio C Hamano
2008-02-15 18:12   ` Johannes Schindelin
2008-02-15 22:21     ` Junio C Hamano
2008-02-16  3:09       ` Johannes Schindelin
2008-02-16 12:48         ` Johannes Schindelin
2008-02-16  6:34   ` Remi Vanicat
2008-02-16  7:54     ` Junio C Hamano [this message]
2008-02-16  8:26       ` Remi Vanicat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v63wpcp4o.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=vanicat@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox