File tree 2 files changed +25
-10
lines changed
2 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches
8
8
SYNOPSIS
9
9
--------
10
10
[verse]
11
- 'git filter-branch' [--env-filter <command>] [--tree -filter <command>]
12
- [--index -filter <command>] [--parent -filter <command>]
13
- [--msg -filter <command>] [--commit -filter <command>]
14
- [--tag-name- filter <command>] [--subdirectory- filter <directory >]
15
- [--prune-empty]
11
+ 'git filter-branch' [--setup <command>] [--env -filter <command>]
12
+ [--tree -filter <command>] [--index -filter <command>]
13
+ [--parent -filter <command>] [--msg -filter <command>]
14
+ [--commit- filter <command>] [--tag-name- filter <command >]
15
+ [--subdirectory-filter <directory>] [-- prune-empty]
16
16
[--original <namespace>] [-d <directory>] [-f | --force]
17
17
[--] [<rev-list options>...]
18
18
@@ -82,6 +82,13 @@ multiple commits.
82
82
OPTIONS
83
83
-------
84
84
85
+ --setup <command>::
86
+ This is not a real filter executed for each commit but a one
87
+ time setup just before the loop. Therefore no commit-specific
88
+ variables are defined yet. Functions or variables defined here
89
+ can be used or modified in the following filter steps except
90
+ the commit filter, for technical reasons.
91
+
85
92
--env-filter <command>::
86
93
This filter may be used if you only need to modify the environment
87
94
in which the commit will be performed. Specifically, you might
Original file line number Diff line number Diff line change @@ -81,11 +81,12 @@ set_ident () {
81
81
finish_ident COMMITTER
82
82
}
83
83
84
- USAGE=" [--env-filter <command>] [--tree-filter <command>]
85
- [--index-filter <command>] [--parent-filter <command>]
86
- [--msg-filter <command>] [--commit-filter <command>]
87
- [--tag-name-filter <command>] [--subdirectory-filter <directory>]
88
- [--original <namespace>] [-d <directory>] [-f | --force]
84
+ USAGE=" [--setup <command>] [--env-filter <command>]
85
+ [--tree-filter <command>] [--index-filter <command>]
86
+ [--parent-filter <command>] [--msg-filter <command>]
87
+ [--commit-filter <command>] [--tag-name-filter <command>]
88
+ [--subdirectory-filter <directory>] [--original <namespace>]
89
+ [-d <directory>] [-f | --force]
89
90
[<rev-list options>...]"
90
91
91
92
OPTIONS_SPEC=
@@ -96,6 +97,7 @@ if [ "$(is_bare_repository)" = false ]; then
96
97
fi
97
98
98
99
tempdir=.git-rewrite
100
+ filter_setup=
99
101
filter_env=
100
102
filter_tree=
101
103
filter_index=
148
150
-d)
149
151
tempdir=" $OPTARG "
150
152
;;
153
+ --setup)
154
+ filter_setup=" $OPTARG "
155
+ ;;
151
156
--env-filter)
152
157
filter_env=" $OPTARG "
153
158
;;
317
322
need_index=
318
323
fi
319
324
325
+ eval " $filter_setup " < /dev/null ||
326
+ die " filter setup failed: $filter_setup "
327
+
320
328
while read commit parents; do
321
329
git_filter_branch__commit_count=$(( $git_filter_branch__commit_count + 1 ))
322
330
You can’t perform that action at this time.
0 commit comments