git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>
To: git@vger.kernel.org
Cc: Johannes.Schindelin@gmx.de,
	Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>
Subject: [PATCH] filter-branch documentation: non-zero exit status in command abort the filter
Date: Mon, 25 Feb 2008 23:14:31 -0300	[thread overview]
Message-ID: <1203992071-957-1-git-send-email-cmarcelo@gmail.com> (raw)

Since commit 8c1ce0f46b85d40f215084eed7313896300082df 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>
---
 Documentation/git-filter-branch.txt |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index e22dfa5..9cb01ca 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 <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
@@ -195,10 +197,10 @@ the initial commit - add graftcommit as a parent).  Note that this assumes
 history with a single root (that is, no merge without common ancestors
 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:
 
-- 
1.5.4.3.221.g350ae

             reply	other threads:[~2008-02-26  2:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  2:14 Caio Marcelo de Oliveira Filho [this message]
2008-02-26 11:18 ` [PATCH] filter-branch documentation: non-zero exit status in command abort the filter Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203992071-957-1-git-send-email-cmarcelo@gmail.com \
    --to=cmarcelo@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).