{"thread":{"id":"12323","subject":"[PATCH] filter-branch documentation: non-zero exit status in command abort the filter","startedAt":"2008-02-26T02:14:31Z","lastAt":"2008-02-26T11:18:39Z","messageCount":2,"participants":["Caio Marcelo de Oliveira Filho","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69958","messageId":"1203992071-957-1-git-send-email-cmarcelo@gmail.com","threadId":"12323","inReplyTo":null,"subject":"[PATCH] filter-branch documentation: non-zero exit status in command abort the filter","fromName":"Caio Marcelo de Oliveira Filho","fromEmail":"cmarcelo@gmail.com","sentAt":"2008-02-26T02:14:31Z","receivedAt":"2008-02-26T02:14:31Z","isPatch":true,"sender":{"key":"cmarcelo@gmail.com","avatar":null},"body":"Since commit 8c1ce0f46b85d40f215084eed7313896300082df filter-branch fails\nwhen a <command> has a non-zero exit status. This commit makes it clear\nin the documentation and also fixes the parent-filter example, that was\nincorrectly returning non-zero when the commit being tested wasn't the\none to be rewritten.\n\nSigned-off-by: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>\n---\n Documentation/git-filter-branch.txt |   10 ++++++----\n 1 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex e22dfa5..9cb01ca 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -56,7 +56,9 @@ notable exception of the commit filter, for technical reasons).\n Prior to that, the $GIT_COMMIT environment variable will be set to contain\n the id of the commit being rewritten.  Also, GIT_AUTHOR_NAME,\n GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,\n-and GIT_COMMITTER_DATE are set according to the current commit.\n+and GIT_COMMITTER_DATE are set according to the current commit. If any\n+evaluation of <command> returns a non-zero exit status, the whole operation\n+will be aborted.\n \n A 'map' function is available that takes an \"original sha1 id\" argument\n and outputs a \"rewritten sha1 id\" if the commit has been already\n@@ -195,10 +197,10 @@ the initial commit - add graftcommit as a parent).  Note that this assumes\n history with a single root (that is, no merge without common ancestors\n happened).  If this is not the case, use:\n \n---------------------------------------------------------------------------\n+----------------------------------------------------------------------------\n git filter-branch --parent-filter \\\n-\t'cat; test $GIT_COMMIT = <commit-id> && echo \"-p <graft-id>\"' HEAD\n---------------------------------------------------------------------------\n+\t'test $GIT_COMMIT = <commit-id> && echo \"-p <graft-id>\" || cat' HEAD\n+----------------------------------------------------------------------------\n \n or even simpler:\n \n-- \n1.5.4.3.221.g350ae\n"},{"id":"69976","messageId":"alpine.LSU.1.00.0802261116570.17164@racer.site","threadId":"12323","inReplyTo":"1203992071-957-1-git-send-email-cmarcelo@gmail.com","subject":"Re: [PATCH] filter-branch documentation: non-zero exit status in command abort the filter","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-26T11:18:39Z","receivedAt":"2008-02-26T11:18:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 25 Feb 2008, Caio Marcelo de Oliveira Filho wrote:\n\n> Since commit 8c1ce0f46b85d40f215084eed7313896300082df filter-branch \n> fails when a <command> has a non-zero exit status. This commit makes it \n> clear in the documentation and also fixes the parent-filter example, \n> that was incorrectly returning non-zero when the commit being tested \n> wasn't the one to be rewritten.\n\nI thought that we had that already in the man page, but you're right: we \ndid not.\n\n> ---------------------------------------------------------------------------\n> +----------------------------------------------------------------------------\n>  git filter-branch --parent-filter \\\n> -\t'cat; test $GIT_COMMIT = <commit-id> && echo \"-p <graft-id>\"' HEAD\n> ---------------------------------------------------------------------------\n> +\t'test $GIT_COMMIT = <commit-id> && echo \"-p <graft-id>\" || cat' HEAD\n> +----------------------------------------------------------------------------\n\nYes, makes sense.\n\nCiao,\nDscho\n"}]}