git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Lederhofer <matled@gmx.net>
To: git@vger.kernel.org
Subject: [PATCH] filter-branch: prevent filters from reading from stdin
Date: Tue, 5 Jun 2007 16:12:08 +0200	[thread overview]
Message-ID: <20070605141208.GA23605@moooo.ath.cx> (raw)

stdin is the list of commits when the env, tree and index
filter are executed.  The filters are not supposed to read
anything from stdin so the best is to give them /dev/null
for reading.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
 git-filter-branch.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index f4cfbea..e220b85 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -352,21 +352,21 @@ while read commit; do
 
 	eval "$(set_ident AUTHOR <../commit)"
 	eval "$(set_ident COMMITTER <../commit)"
-	eval "$filter_env"
+	eval "$filter_env" < /dev/null
 
 	if [ "$filter_tree" ]; then
 		git-checkout-index -f -u -a
 		# files that $commit removed are now still in the working tree;
 		# remove them, else they would be added again
 		git-ls-files -z --others | xargs -0 rm -f
-		eval "$filter_tree"
+		eval "$filter_tree" < /dev/null
 		git-diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \
 			xargs -0 git-update-index --add --replace --remove
 		git-ls-files -z --others | \
 			xargs -0 git-update-index --add --replace --remove
 	fi
 
-	eval "$filter_index"
+	eval "$filter_index" < /dev/null
 
 	parentstr=
 	for parent in $(get_parents $commit); do
-- 
1.5.2.1.120.g3877-dirty

             reply	other threads:[~2007-06-05 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 14:12 Matthias Lederhofer [this message]
2007-06-05 16:10 ` [PATCH] filter-branch: prevent filters from reading from stdin 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=20070605141208.GA23605@moooo.ath.cx \
    --to=matled@gmx.net \
    --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).