Skip to content

Commit e336afd

Browse files
committed
Merge branch 'dg/filter-branch-filter-order-doc'
Update the documentation for "git filter-branch" so that the filter options are listed in the same order as they are applied, as described in an earlier part of the doc. * dg/filter-branch-filter-order-doc: doc: list filter-branch subdirectory-filter first
2 parents 39a2aea + 07c4984 commit e336afd

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Documentation/git-filter-branch.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches
88
SYNOPSIS
99
--------
1010
[verse]
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]
11+
'git filter-branch' [--setup <command>] [--subdirectory-filter <directory>]
12+
[--env-filter <command>] [--tree-filter <command>]
13+
[--index-filter <command>] [--parent-filter <command>]
14+
[--msg-filter <command>] [--commit-filter <command>]
15+
[--tag-name-filter <command>] [--prune-empty]
1616
[--original <namespace>] [-d <directory>] [-f | --force]
1717
[--state-branch <branch>] [--] [<rev-list options>...]
1818

@@ -89,6 +89,11 @@ OPTIONS
8989
can be used or modified in the following filter steps except
9090
the commit filter, for technical reasons.
9191

92+
--subdirectory-filter <directory>::
93+
Only look at the history which touches the given subdirectory.
94+
The result will contain that directory (and only that) as its
95+
project root. Implies <<Remap_to_ancestor>>.
96+
9297
--env-filter <command>::
9398
This filter may be used if you only need to modify the environment
9499
in which the commit will be performed. Specifically, you might
@@ -167,11 +172,6 @@ be removed, buyer beware. There is also no support for changing the
167172
author or timestamp (or the tag message for that matter). Tags which point
168173
to other tags will be rewritten to point to the underlying commit.
169174

170-
--subdirectory-filter <directory>::
171-
Only look at the history which touches the given subdirectory.
172-
The result will contain that directory (and only that) as its
173-
project root. Implies <<Remap_to_ancestor>>.
174-
175175
--prune-empty::
176176
Some filters will generate empty commits that leave the tree untouched.
177177
This option instructs git-filter-branch to remove such commits if they

git-filter-branch.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ set_ident () {
8181
finish_ident COMMITTER
8282
}
8383

84-
USAGE="[--setup <command>] [--env-filter <command>]
84+
USAGE="[--setup <command>] [--subdirectory-filter <directory>] [--env-filter <command>]
8585
[--tree-filter <command>] [--index-filter <command>]
8686
[--parent-filter <command>] [--msg-filter <command>]
8787
[--commit-filter <command>] [--tag-name-filter <command>]
88-
[--subdirectory-filter <directory>] [--original <namespace>]
88+
[--original <namespace>]
8989
[-d <directory>] [-f | --force] [--state-branch <branch>]
9090
[--] [<rev-list options>...]"
9191

@@ -154,6 +154,10 @@ do
154154
--setup)
155155
filter_setup="$OPTARG"
156156
;;
157+
--subdirectory-filter)
158+
filter_subdir="$OPTARG"
159+
remap_to_ancestor=t
160+
;;
157161
--env-filter)
158162
filter_env="$OPTARG"
159163
;;
@@ -175,10 +179,6 @@ do
175179
--tag-name-filter)
176180
filter_tag_name="$OPTARG"
177181
;;
178-
--subdirectory-filter)
179-
filter_subdir="$OPTARG"
180-
remap_to_ancestor=t
181-
;;
182182
--original)
183183
orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
184184
;;

0 commit comments

Comments
 (0)