From 07c4984508865984fdfdedf2e1cdf86328221af4 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Tue, 17 Oct 2017 09:45:15 +0000 Subject: 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 Signed-off-by: Junio C Hamano diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 9e5169a..394f744 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches SYNOPSIS -------- [verse] -'git filter-branch' [--setup ] [--env-filter ] - [--tree-filter ] [--index-filter ] - [--parent-filter ] [--msg-filter ] - [--commit-filter ] [--tag-name-filter ] - [--subdirectory-filter ] [--prune-empty] +'git filter-branch' [--setup ] [--subdirectory-filter ] + [--env-filter ] [--tree-filter ] + [--index-filter ] [--parent-filter ] + [--msg-filter ] [--commit-filter ] + [--tag-name-filter ] [--prune-empty] [--original ] [-d ] [-f | --force] [--] [...] @@ -89,6 +89,11 @@ OPTIONS can be used or modified in the following filter steps except the commit filter, for technical reasons. +--subdirectory-filter :: + Only look at the history which touches the given subdirectory. + The result will contain that directory (and only that) as its + project root. Implies <>. + --env-filter :: This filter may be used if you only need to modify the environment 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 to other tags will be rewritten to point to the underlying commit. ---subdirectory-filter :: - Only look at the history which touches the given subdirectory. - The result will contain that directory (and only that) as its - project root. Implies <>. - --prune-empty:: Some filters will generate empty commits that leave the tree untouched. This option instructs git-filter-branch to remove such commits if they diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 3a74602..b7827e7 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -81,12 +81,12 @@ set_ident () { finish_ident COMMITTER } -USAGE="[--setup ] [--env-filter ] - [--tree-filter ] [--index-filter ] - [--parent-filter ] [--msg-filter ] - [--commit-filter ] [--tag-name-filter ] - [--subdirectory-filter ] [--original ] - [-d ] [-f | --force] +USAGE="[--setup ] [--subdirectory-filter ] + [--env-filter ] [--tree-filter ] + [--index-filter ] [--parent-filter ] + [--msg-filter ] [--commit-filter ] + [--tag-name-filter ] [--prune-empty] + [--original ] [-d ] [-f | --force] [--] [...]" OPTIONS_SPEC= @@ -153,6 +153,10 @@ do --setup) filter_setup="$OPTARG" ;; + --subdirectory-filter) + filter_subdir="$OPTARG" + remap_to_ancestor=t + ;; --env-filter) filter_env="$OPTARG" ;; @@ -174,10 +178,6 @@ do --tag-name-filter) filter_tag_name="$OPTARG" ;; - --subdirectory-filter) - filter_subdir="$OPTARG" - remap_to_ancestor=t - ;; --original) orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/ ;; -- cgit v0.10.2-6-g49f6