summaryrefslogtreecommitdiff
path: root/Documentation/git-filter-branch.txt
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2007-07-04 07:32:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-04 20:32:41 (GMT)
commit32c37c123741bee79617a6830257519c53681704 (patch)
tree79510922e7783e841b1756966906d8a3a9b7a1ce /Documentation/git-filter-branch.txt
parentb5669a05043e402f2f41636c1b18e7865f41b9c0 (diff)
downloadgit-32c37c123741bee79617a6830257519c53681704.zip
git-32c37c123741bee79617a6830257519c53681704.tar.gz
git-32c37c123741bee79617a6830257519c53681704.tar.bz2
filter-branch documentation: some more touch-ups.
- The map function used to fail, but no longer does (since 3520e1e8687.) - Fix the "edge-graft" example. - Show the same using .git/info/grafts. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-filter-branch.txt')
-rw-r--r--Documentation/git-filter-branch.txt23
1 files changed, 16 insertions, 7 deletions
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 363287d..219a81d 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -58,8 +58,9 @@ and GIT_COMMITTER_DATE are set according to the current commit.
A 'map' function is available that takes an "original sha1 id" argument
and outputs a "rewritten sha1 id" if the commit has been already
-rewritten, fails otherwise; the 'map' function can return several
-ids on separate lines if your commit filter emitted multiple commits.
+rewritten, and "original sha1 id" otherwise; the 'map' function can
+return several ids on separate lines if your commit filter emitted
+multiple commits.
OPTIONS
@@ -166,12 +167,13 @@ git filter-branch --index-filter 'git update-index --remove filename' newbranch
Now, you will get the rewritten history saved in the branch 'newbranch'
(your current branch is left untouched).
-To "etch-graft" a commit to the revision history (set a commit to be
-the parent of the current initial commit and propagate that):
+To set a commit (which typically is at the tip of another
+history) to be the parent of the current initial commit, in
+order to paste the other history behind the current history:
-----------------------------------------------------------------------
-git filter-branch --parent-filter sed\ 's/^$/-p <graft-id>/' newbranch
-----------------------------------------------------------------------
+------------------------------------------------------------------------
+git filter-branch --parent-filter 'sed "s/^\$/-p <graft-id>/"' newbranch
+------------------------------------------------------------------------
(if the parent string is empty - therefore we are dealing with the
initial commit - add graftcommit as a parent). Note that this assumes
@@ -183,6 +185,13 @@ git filter-branch --parent-filter \
'cat; test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>"' newbranch
-------------------------------------------------------------------------------
+or even simpler:
+
+-----------------------------------------------
+echo "$commit-id $graft-id" >> .git/info/grafts
+git filter-branch newbranch $graft-id..
+-----------------------------------------------
+
To remove commits authored by "Darl McBribe" from the history:
------------------------------------------------------------------------------