Code

Revert "filter-branch: subdirectory filter needs --full-history"
[git.git] / git-filter-branch.sh
index 010353ad82881886b9739cc5f8de595acc9273ef..d846cd9c929e290e00da61167a9cb80ce30691eb 100755 (executable)
@@ -58,8 +58,8 @@ eval "$functions"
 # "author" or "committer
 
 set_ident () {
-       lid="$(echo "$1" | tr "A-Z" "a-z")"
-       uid="$(echo "$1" | tr "a-z" "A-Z")"
+       lid="$(echo "$1" | tr "[A-Z]" "[a-z]")"
+       uid="$(echo "$1" | tr "[a-z]" "[A-Z]")"
        pick_id_script='
                /^'$lid' /{
                        s/'\''/'\''\\'\'\''/g
@@ -234,7 +234,7 @@ case "$filter_subdir" in
        ;;
 *)
        git rev-list --reverse --topo-order --default HEAD \
-               --parents --full-history "$@" -- "$filter_subdir"
+               --parents "$@" -- "$filter_subdir"
 esac > ../revs || die "Could not get the commits"
 commits=$(wc -l <../revs | tr -d " ")
 
@@ -281,7 +281,7 @@ while read commit parents; do
                        die "Could not checkout the index"
                # files that $commit removed are now still in the working tree;
                # remove them, else they would be added again
-               git ls-files -z --others | xargs -0 rm -f
+               git clean -d -q -f -x
                eval "$filter_tree" < /dev/null ||
                        die "tree filter failed: $filter_tree"
 
@@ -309,7 +309,7 @@ while read commit parents; do
        sed -e '1,/^$/d' <../commit | \
                eval "$filter_msg" > ../message ||
                        die "msg filter failed: $filter_msg"
-       sh -c "$filter_commit" "git commit-tree" \
+       @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
                $(git write-tree) $parentstr < ../message > ../map/$commit
 done <../revs