doc: list filter-branch subdirectory-filter first

The docs claim that filters are applied in the listed order, so subdirectory-filter should come first. For consistency, apply the same order to the SYNOPSIS and the script's usage, as well as the switch while parsing arguments. Add missing --prune-empty to the script's usage. Signed-off-by: David Glasser <glasser@davidglasser.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Glasser committed Oct 17, 2017 at 09:45 UTC 07c4984508865984fdfdedf2e1cdf86328221af4
2 files changed +20 -20
Documentation/git-filter-branch.txt
+10 -10
@@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches
8 SYNOPSIS
9 --------
10 [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]
16 [--original <namespace>] [-d <directory>] [-f | --force]
17 [--] [<rev-list options>...]
18
@@ -89,6 +89,11 @@ OPTIONS
89 can be used or modified in the following filter steps except
90 the commit filter, for technical reasons.
91
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 +
97 --env-filter <command>::
98 This filter may be used if you only need to modify the environment
99 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
172 author or timestamp (or the tag message for that matter). Tags which point
173 to other tags will be rewritten to point to the underlying commit.
174
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 -
175 --prune-empty::
176 Some filters will generate empty commits that leave the tree untouched.
177 This option instructs git-filter-branch to remove such commits if they
git-filter-branch.sh
+10 -10
@@ -81,12 +81,12 @@ set_ident () {
81 finish_ident COMMITTER
82 }
83
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]
84 +USAGE="[--setup <command>] [--subdirectory-filter <directory>]
85 + [--env-filter <command>] [--tree-filter <command>]
86 + [--index-filter <command>] [--parent-filter <command>]
87 + [--msg-filter <command>] [--commit-filter <command>]
88 + [--tag-name-filter <command>] [--prune-empty]
89 + [--original <namespace>] [-d <directory>] [-f | --force]
90 [--] [<rev-list options>...]"
91
92 OPTIONS_SPEC=
@@ -153,6 +153,10 @@ do
153 --setup)
154 filter_setup="$OPTARG"
155 ;;
156 + --subdirectory-filter)
157 + filter_subdir="$OPTARG"
158 + remap_to_ancestor=t
159 + ;;
160 --env-filter)
161 filter_env="$OPTARG"
162 ;;
@@ -174,10 +178,6 @@ do
178 --tag-name-filter)
179 filter_tag_name="$OPTARG"
180 ;;
177 - --subdirectory-filter)
178 - filter_subdir="$OPTARG"
179 - remap_to_ancestor=t
180 - ;;
181 --original)
182 orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
183 ;;