summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-10-19 14:45:45 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-10-19 14:45:45 +0900
commite336afdfb67384aa058eeb47687545f0492ed40c (patch)
treea417db3628b605e716b54cf2e0a01d5a00d7622b
parentMerge branch 'jc/fetch-refspec-doc-update' (diff)
parentdoc: list filter-branch subdirectory-filter first (diff)
downloadtgif-e336afdfb67384aa058eeb47687545f0492ed40c.tar.xz
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
-rw-r--r--Documentation/git-filter-branch.txt20
-rwxr-xr-xgit-filter-branch.sh12
2 files changed, 16 insertions, 16 deletions
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index bebdcdec5a..3a52e4dce3 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 <command>] [--env-filter <command>]
- [--tree-filter <command>] [--index-filter <command>]
- [--parent-filter <command>] [--msg-filter <command>]
- [--commit-filter <command>] [--tag-name-filter <command>]
- [--subdirectory-filter <directory>] [--prune-empty]
+'git filter-branch' [--setup <command>] [--subdirectory-filter <directory>]
+ [--env-filter <command>] [--tree-filter <command>]
+ [--index-filter <command>] [--parent-filter <command>]
+ [--msg-filter <command>] [--commit-filter <command>]
+ [--tag-name-filter <command>] [--prune-empty]
[--original <namespace>] [-d <directory>] [-f | --force]
[--state-branch <branch>] [--] [<rev-list options>...]
@@ -89,6 +89,11 @@ OPTIONS
can be used or modified in the following filter steps except
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>::
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 <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::
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 3365a3b866..1b7e4b2cdb 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -81,11 +81,11 @@ set_ident () {
finish_ident COMMITTER
}
-USAGE="[--setup <command>] [--env-filter <command>]
+USAGE="[--setup <command>] [--subdirectory-filter <directory>] [--env-filter <command>]
[--tree-filter <command>] [--index-filter <command>]
[--parent-filter <command>] [--msg-filter <command>]
[--commit-filter <command>] [--tag-name-filter <command>]
- [--subdirectory-filter <directory>] [--original <namespace>]
+ [--original <namespace>]
[-d <directory>] [-f | --force] [--state-branch <branch>]
[--] [<rev-list options>...]"
@@ -154,6 +154,10 @@ do
--setup)
filter_setup="$OPTARG"
;;
+ --subdirectory-filter)
+ filter_subdir="$OPTARG"
+ remap_to_ancestor=t
+ ;;
--env-filter)
filter_env="$OPTARG"
;;
@@ -175,10 +179,6 @@ do
--tag-name-filter)
filter_tag_name="$OPTARG"
;;
- --subdirectory-filter)
- filter_subdir="$OPTARG"
- remap_to_ancestor=t
- ;;
--original)
orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
;;