X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-filter-branch.sh;h=962a93b586571eb6fc60aae53c77f6e6b9fb281f;hb=2794ad524462c4e2ecd4573d650e7b4f8da89a5d;hp=195b5ef48ed3371b2010f9caf711e12089da9c06;hpb=2d0d706e5fd08b751a19562974ae0b76d9db03a1;p=git.git diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 195b5ef48..962a93b58 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -139,6 +139,7 @@ do continue ;; --remap-to-ancestor) + # deprecated ($remap_to_ancestor is set now automatically) shift remap_to_ancestor=t continue @@ -207,7 +208,7 @@ t,) ,*) ;; *) - die "Cannot set --prune-empty and --filter-commit at the same time" + die "Cannot set --prune-empty and --commit-filter at the same time" esac case "$force" in @@ -265,7 +266,14 @@ mkdir ../map || die "Could not create map/ directory" # we need "--" only if there are no path arguments in $@ nonrevs=$(git rev-parse --no-revs "$@") || exit -test -z "$nonrevs" && dashdash=-- || dashdash= +if test -z "$nonrevs" +then + dashdash=-- +else + dashdash= + remap_to_ancestor=t +fi + rev_args=$(git rev-parse --revs-only "$@") case "$filter_subdir" in @@ -331,7 +339,7 @@ while read commit parents; do die "tree filter failed: $filter_tree" ( - git diff-index -r --name-only $commit && + git diff-index -r --name-only --ignore-submodules $commit && git ls-files --others ) > "$tempdir"/tree-state || exit git update-index --add --replace --remove --stdin \ @@ -462,11 +470,11 @@ if [ "$filter_tag_name" ]; then "$new_sha1" "$new_ref" git cat-file tag "$ref" | sed -n \ - -e "1,/^$/{ + -e '1,/^$/{ /^object /d /^type /d /^tag /d - }" \ + }' \ -e '/^-----BEGIN PGP SIGNATURE-----/q' \ -e 'p' ) | git mktag) ||