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>
This commit is contained in:
David Glasser 2017-10-17 09:45:15 +00:00 коммит произвёл Junio C Hamano
Родитель 4010f1d1b7
Коммит 07c4984508
2 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git filter-branch' [--setup <command>] [--env-filter <command>] 'git filter-branch' [--setup <command>] [--subdirectory-filter <directory>]
[--tree-filter <command>] [--index-filter <command>] [--env-filter <command>] [--tree-filter <command>]
[--parent-filter <command>] [--msg-filter <command>] [--index-filter <command>] [--parent-filter <command>]
[--commit-filter <command>] [--tag-name-filter <command>] [--msg-filter <command>] [--commit-filter <command>]
[--subdirectory-filter <directory>] [--prune-empty] [--tag-name-filter <command>] [--prune-empty]
[--original <namespace>] [-d <directory>] [-f | --force] [--original <namespace>] [-d <directory>] [-f | --force]
[--] [<rev-list options>...] [--] [<rev-list options>...]
@ -89,6 +89,11 @@ OPTIONS
can be used or modified in the following filter steps except can be used or modified in the following filter steps except
the commit filter, for technical reasons. the commit filter, for technical reasons.
--subdirectory-filter <directory>::
Only look at the history which touches the given subdirectory.
The result will contain that directory (and only that) as its
project root. Implies <<Remap_to_ancestor>>.
--env-filter <command>:: --env-filter <command>::
This filter may be used if you only need to modify the environment This filter may be used if you only need to modify the environment
in which the commit will be performed. Specifically, you might 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
author or timestamp (or the tag message for that matter). Tags which point author or timestamp (or the tag message for that matter). Tags which point
to other tags will be rewritten to point to the underlying commit. to other tags will be rewritten to point to the underlying commit.
--subdirectory-filter <directory>::
Only look at the history which touches the given subdirectory.
The result will contain that directory (and only that) as its
project root. Implies <<Remap_to_ancestor>>.
--prune-empty:: --prune-empty::
Some filters will generate empty commits that leave the tree untouched. Some filters will generate empty commits that leave the tree untouched.
This option instructs git-filter-branch to remove such commits if they This option instructs git-filter-branch to remove such commits if they

Просмотреть файл

@ -81,12 +81,12 @@ set_ident () {
finish_ident COMMITTER finish_ident COMMITTER
} }
USAGE="[--setup <command>] [--env-filter <command>] USAGE="[--setup <command>] [--subdirectory-filter <directory>]
[--tree-filter <command>] [--index-filter <command>] [--env-filter <command>] [--tree-filter <command>]
[--parent-filter <command>] [--msg-filter <command>] [--index-filter <command>] [--parent-filter <command>]
[--commit-filter <command>] [--tag-name-filter <command>] [--msg-filter <command>] [--commit-filter <command>]
[--subdirectory-filter <directory>] [--original <namespace>] [--tag-name-filter <command>] [--prune-empty]
[-d <directory>] [-f | --force] [--original <namespace>] [-d <directory>] [-f | --force]
[--] [<rev-list options>...]" [--] [<rev-list options>...]"
OPTIONS_SPEC= OPTIONS_SPEC=
@ -153,6 +153,10 @@ do
--setup) --setup)
filter_setup="$OPTARG" filter_setup="$OPTARG"
;; ;;
--subdirectory-filter)
filter_subdir="$OPTARG"
remap_to_ancestor=t
;;
--env-filter) --env-filter)
filter_env="$OPTARG" filter_env="$OPTARG"
;; ;;
@ -174,10 +178,6 @@ do
--tag-name-filter) --tag-name-filter)
filter_tag_name="$OPTARG" filter_tag_name="$OPTARG"
;; ;;
--subdirectory-filter)
filter_subdir="$OPTARG"
remap_to_ancestor=t
;;
--original) --original)
orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/ orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
;; ;;