From ed10d9aa3f771ad343df5aa50d9004945f7a4e56 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 25 Feb 2008 15:43:53 +0100 Subject: Documentation/git-filter-branch: add a new msg-filter example There were no example on how to edit commit messages, so add an msg-filter example. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/git-filter-branch.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index e22dfa5803..1948f6f72c 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -240,6 +240,15 @@ committed a merge between P1 and P2, it will be propagated properly 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 `--message-filter`. For +example, `git-svn-id` strings in a repository created by `git-svn` can +be removed this way: + +------------------------------------------------------- +git filter-branch --message-filter ' + sed -e "/^git-svn-id:/d" +' +------------------------------------------------------- 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 -- cgit v1.2.3 From 41e86a377496231709a5fb78df730df7be80b6c9 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Mon, 25 Feb 2008 23:14:31 -0300 Subject: filter-branch documentation: non-zero exit status in command abort the filter Since commit 8c1ce0f46b85d40f215084eed7313896300082df filter-branch fails when a has a non-zero exit status. This commit makes it clear in the documentation and also fixes the parent-filter example, that was incorrectly returning non-zero when the commit being tested wasn't the one to be rewritten. Signed-off-by: Caio Marcelo de Oliveira Filho Signed-off-by: Junio C Hamano --- Documentation/git-filter-branch.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 1948f6f72c..543a1cf105 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -56,7 +56,9 @@ notable exception of the commit filter, for technical reasons). Prior to that, the $GIT_COMMIT environment variable will be set to contain the id of the commit being rewritten. Also, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, -and GIT_COMMITTER_DATE are set according to the current commit. +and GIT_COMMITTER_DATE are set according to the current commit. If any +evaluation of returns a non-zero exit status, the whole operation +will be aborted. A 'map' function is available that takes an "original sha1 id" argument and outputs a "rewritten sha1 id" if the commit has been already @@ -197,7 +199,7 @@ happened). If this is not the case, use: -------------------------------------------------------------------------- git filter-branch --parent-filter \ - 'cat; test $GIT_COMMIT = && echo "-p "' HEAD + 'test $GIT_COMMIT = && echo "-p " || cat' HEAD -------------------------------------------------------------------------- or even simpler: -- cgit v1.2.3 From 81fa145917c40b68a5e2cca6afc6a10cdfdbd25b Mon Sep 17 00:00:00 2001 From: Bryan Donlan Date: Mon, 25 Feb 2008 17:40:19 -0500 Subject: Documentation/git-am.txt: Pass -r in the example invocation of rm -f .dotest Signed-off-by: Bryan Donlan Signed-off-by: Junio C Hamano --- Documentation/git-am.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index 2ffba2102b..e640fc75cd 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -138,7 +138,7 @@ aborts in the middle,. You can recover from this in one of two ways: The command refuses to process new mailboxes while `.dotest` directory exists, so if you decide to start over from scratch, -run `rm -f .dotest` before running the command with mailbox +run `rm -f -r .dotest` before running the command with mailbox names. -- cgit v1.2.3