Skip to content

Commit

Permalink
filter-branch documentation: non-zero exit status in command abort th…
Browse files Browse the repository at this point in the history
…e filter

Since commit 8c1ce0f filter-branch fails
when a <command> 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 <cmarcelo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Caio Marcelo de Oliveira Filho authored and Junio C Hamano committed Feb 26, 2008
1 parent e103343 commit 41e86a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Documentation/git-filter-branch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command> 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
Expand Down Expand Up @@ -197,7 +199,7 @@ happened). If this is not the case, use:

--------------------------------------------------------------------------
git filter-branch --parent-filter \
'cat; test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>"' HEAD
'test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>" || cat' HEAD
--------------------------------------------------------------------------

or even simpler:
Expand Down

0 comments on commit 41e86a3

Please sign in to comment.