aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-filter-branch.txt
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-02-23 02:27:35 -0600
committerJunio C Hamano <gitster@pobox.com>2017-03-03 12:43:37 -0800
commita582a82d2444b627260a764c17d3137d9d255531 (patch)
treee352502dbc0c4427e4b582040a36cbab4145eda9 /Documentation/git-filter-branch.txt
parent4dacc8f11d4acfb43d76e2a1abc2d2a57d5a2691 (diff)
downloadgit-a582a82d2444b627260a764c17d3137d9d255531.tar.gz
filter-branch: fix --prune-empty on parentless commits
Previously, the git_commit_non_empty_tree function would always pass any commit with no parents to git-commit-tree, regardless of whether the tree was nonempty. The new commit would then be recorded in the filter-branch revision map, and subsequent commits which leave the tree untouched would be correctly filtered. With this change, parentless commits with an empty tree are correctly pruned, and an empty file is recorded in the revision map, signifying that it was rewritten to "no commits." This works naturally with the parent mapping for subsequent commits. Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-filter-branch.txt')
-rw-r--r--Documentation/git-filter-branch.txt14
1 files changed, 6 insertions, 8 deletions
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 0a09698c03..6e4bb02204 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -167,14 +167,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