Merge branch 'hv/t5526-andand-chain-fix' into next
[gitweb.git] / Documentation / git-filter-branch.txt
index 0a09698c033fb2e1cdf68aa33eed4f109a034d5f..9e5169aa64f4ffd5ea42f85b2dbe812086e9652c 100644 (file)
@@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches
 SYNOPSIS
 --------
 [verse]
-'git filter-branch' [--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>] [--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]
        [--original <namespace>] [-d <directory>] [-f | --force]
        [--] [<rev-list options>...]
 
@@ -82,12 +82,18 @@ multiple commits.
 OPTIONS
 -------
 
+--setup <command>::
+       This is not a real filter executed for each commit but a one
+       time setup just before the loop. Therefore no commit-specific
+       variables are defined yet.  Functions or variables defined here
+       can be used or modified in the following filter steps except
+       the commit filter, for technical reasons.
+
 --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
        want to rewrite the author/committer name/email/time environment
-       variables (see linkgit:git-commit-tree[1] for details).  Do not forget
-       to re-export the variables.
+       variables (see linkgit:git-commit-tree[1] for details).
 
 --tree-filter <command>::
        This is the filter for rewriting the tree and its contents.
@@ -167,14 +173,12 @@ to other tags will be rewritten to point to the underlying commit.
        project root. Implies <<Remap_to_ancestor>>.
 
 --prune-empty::
-       Some kind of filters will generate empty commits, that left the tree
-       untouched.  This switch allow git-filter-branch to ignore such
-       commits.  Though, this switch only applies for commits that have one
-       and only one parent, it will hence keep merges points. Also, this
-       option is not compatible with the use of `--commit-filter`. Though you
-       just need to use the function 'git_commit_non_empty_tree "$@"' instead
-       of the `git commit-tree "$@"` idiom in your commit filter to make that
-       happen.
+       Some filters will generate empty commits that leave the tree untouched.
+       This option instructs git-filter-branch to remove such commits if they
+       have exactly one or zero non-pruned parents; merge commits will
+       therefore remain intact.  This option cannot be used together with
+       `--commit-filter`, though the same effect can be achieved by using the
+       provided `git_commit_non_empty_tree` function in a commit filter.
 
 --original <namespace>::
        Use this option to set the namespace where the original commits
@@ -342,12 +346,10 @@ git filter-branch --env-filter '
        if test "$GIT_AUTHOR_EMAIL" = "root@localhost"
        then
                GIT_AUTHOR_EMAIL=john@example.com
-               export GIT_AUTHOR_EMAIL
        fi
        if test "$GIT_COMMITTER_EMAIL" = "root@localhost"
        then
                GIT_COMMITTER_EMAIL=john@example.com
-               export GIT_COMMITTER_EMAIL
        fi
 ' -- --all
 --------------------------------------------------------