summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index aafaf70..3a74602 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -81,12 +81,13 @@ set_ident () {
finish_ident COMMITTER
}
-USAGE="[--env-filter <command>] [--tree-filter <command>]
- [--index-filter <command>] [--parent-filter <command>]
- [--msg-filter <command>] [--commit-filter <command>]
- [--tag-name-filter <command>] [--subdirectory-filter <directory>]
- [--original <namespace>] [-d <directory>] [-f | --force]
- [<rev-list options>...]"
+USAGE="[--setup <command>] [--env-filter <command>]
+ [--tree-filter <command>] [--index-filter <command>]
+ [--parent-filter <command>] [--msg-filter <command>]
+ [--commit-filter <command>] [--tag-name-filter <command>]
+ [--subdirectory-filter <directory>] [--original <namespace>]
+ [-d <directory>] [-f | --force]
+ [--] [<rev-list options>...]"
OPTIONS_SPEC=
. git-sh-setup
@@ -96,6 +97,7 @@ if [ "$(is_bare_repository)" = false ]; then
fi
tempdir=.git-rewrite
+filter_setup=
filter_env=
filter_tree=
filter_index=
@@ -148,6 +150,9 @@ do
-d)
tempdir="$OPTARG"
;;
+ --setup)
+ filter_setup="$OPTARG"
+ ;;
--env-filter)
filter_env="$OPTARG"
;;
@@ -317,6 +322,9 @@ else
need_index=
fi
+eval "$filter_setup" < /dev/null ||
+ die "filter setup failed: $filter_setup"
+
while read commit parents; do
git_filter_branch__commit_count=$(($git_filter_branch__commit_count+1))