X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-filter-branch.txt;h=020028cf9a54540f5e0e403b52e08dd2921a644e;hb=1c80c9b2cb5ae0d8c77f3c73730225ca19aeef4a;hp=394a77a35f2019f5c86f9e90e94b88cf56da04ae;hpb=7f43e75adc1c238f27a89b4e7a30a1c874fd01f9;p=git.git diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 394a77a35..020028cf9 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -116,7 +116,7 @@ OPTIONS --commit-filter :: This is the filter for performing the commit. If this filter is specified, it will be called instead of the - 'git-commit-tree' command, with arguments of the form + 'git commit-tree' command, with arguments of the form " [-p ]..." and the log message on stdin. The commit id is expected on stdout. + @@ -127,10 +127,10 @@ have all of them as parents. You can use the 'map' convenience function in this filter, and other convenience functions, too. For example, calling 'skip_commit "$@"' will leave out the current commit (but not its changes! If you want -that, use 'git-rebase' instead). +that, use 'git rebase' instead). + -You can also use the 'git_commit_non_empty_tree "$@"' instead of -'git commit-tree "$@"' if you don't wish to keep commits with a single parent +You can also use the `git_commit_non_empty_tree "$@"` instead of +`git commit-tree "$@"` if you don't wish to keep commits with a single parent and that makes no change to the tree. --tag-name-filter :: @@ -179,7 +179,7 @@ the nearest ancestor that was not excluded. 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 + of the `git commit-tree "$@"` idiom in your commit filter to make that happen. --original :: @@ -196,15 +196,15 @@ the nearest ancestor that was not excluded. -f:: --force:: - 'git-filter-branch' refuses to start with an existing temporary + 'git filter-branch' refuses to start with an existing temporary directory or when there are already refs starting with 'refs/original/', unless forced. ...:: - Arguments for 'git-rev-list'. All positive refs included by + Arguments for 'git rev-list'. All positive refs included by these options are rewritten. You may also specify options such as '--all', but you must use '--' to separate them from - the 'git-filter-branch' options. + the 'git filter-branch' options. Examples @@ -221,7 +221,7 @@ However, if the file is absent from the tree of some commit, a simple `rm filename` will fail for that tree and commit. Thus you may instead want to use `rm -f filename` as the script. -Using `\--index-filter` with 'git-rm' yields a significantly faster +Using `\--index-filter` with 'git rm' yields a significantly faster version. Like with using `rm filename`, `git rm --cached filename` will fail if the file is absent from the tree of a commit. If you want to "completely forget" a file, it does not matter when it entered @@ -303,7 +303,7 @@ and all children of the merge will become merge commits with P1,P2 as their parents instead of the merge commit. You can rewrite the commit log messages using `--msg-filter`. For -example, 'git-svn-id' strings in a repository created by 'git-svn' can +example, 'git svn-id' strings in a repository created by 'git svn' can be removed this way: ------------------------------------------------------- @@ -314,7 +314,7 @@ git filter-branch --msg-filter ' To restrict rewriting to only part of the history, specify a revision range in addition to the new branch name. The new branch name will -point to the top-most revision that a 'git-rev-list' of this range +point to the top-most revision that a 'git rev-list' of this range will print. If you need to add 'Acked-by' lines to, say, the last 10 commits (none @@ -330,7 +330,7 @@ git filter-branch --msg-filter ' *NOTE* the changes introduced by the commits, and which are not reverted by subsequent commits, will still be in the rewritten branch. If you want to throw out _changes_ together with the commits, you should use the -interactive mode of 'git-rebase'. +interactive mode of 'git rebase'. Consider this history: @@ -358,7 +358,7 @@ To move the whole tree into a subdirectory, or remove it from there: --------------------------------------------------------------- git filter-branch --index-filter \ - 'git ls-files -s | sed "s-\t-&newsubdir/-" | + 'git ls-files -s | sed "s-\t\"*-&newsubdir/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD