Code

git-filter-branch.sh: more portable tr usage: use \012, not \n.
authorJim Meyering <jim@meyering.net>
Tue, 18 Dec 2007 10:03:23 +0000 (11:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Dec 2007 20:00:26 +0000 (12:00 -0800)
I hesitate to suggest this, since GNU tr has accepted \n for 15 years,
but there are supposedly a few crufty vendor-supplied versions of tr still
in use.  Also, all of the other uses of tr-with-newline in git use \012.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-filter-branch.sh

index 7f52b591a3037f5223b1a48e9ea909111ff37971..ae29f47e41cde04599c22603173c8aaa4ef533d9 100755 (executable)
@@ -290,7 +290,7 @@ 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 '\n' '\000' | \
+               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