{"thread":{"id":"8442","subject":"[PATCH] filter-branch: prevent filters from reading from stdin","startedAt":"2007-06-05T14:12:08Z","lastAt":"2007-06-05T16:10:13Z","messageCount":2,"participants":["Matthias Lederhofer","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"44075","messageId":"20070605141208.GA23605@moooo.ath.cx","threadId":"8442","inReplyTo":null,"subject":"[PATCH] filter-branch: prevent filters from reading from stdin","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-06-05T14:12:08Z","receivedAt":"2007-06-05T14:12:08Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"stdin is the list of commits when the env, tree and index\nfilter are executed.  The filters are not supposed to read\nanything from stdin so the best is to give them /dev/null\nfor reading.\n\nSigned-off-by: Matthias Lederhofer <matled@gmx.net>\n---\n git-filter-branch.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex f4cfbea..e220b85 100644\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -352,21 +352,21 @@ while read commit; do\n \n \teval \"$(set_ident AUTHOR <../commit)\"\n \teval \"$(set_ident COMMITTER <../commit)\"\n-\teval \"$filter_env\"\n+\teval \"$filter_env\" < /dev/null\n \n \tif [ \"$filter_tree\" ]; then\n \t\tgit-checkout-index -f -u -a\n \t\t# files that $commit removed are now still in the working tree;\n \t\t# remove them, else they would be added again\n \t\tgit-ls-files -z --others | xargs -0 rm -f\n-\t\teval \"$filter_tree\"\n+\t\teval \"$filter_tree\" < /dev/null\n \t\tgit-diff-index -r $commit | cut -f 2- | tr '\\n' '\\0' | \\\n \t\t\txargs -0 git-update-index --add --replace --remove\n \t\tgit-ls-files -z --others | \\\n \t\t\txargs -0 git-update-index --add --replace --remove\n \tfi\n \n-\teval \"$filter_index\"\n+\teval \"$filter_index\" < /dev/null\n \n \tparentstr=\n \tfor parent in $(get_parents $commit); do\n-- \n1.5.2.1.120.g3877-dirty\n"},{"id":"44077","messageId":"Pine.LNX.4.64.0706051704170.4046@racer.site","threadId":"8442","inReplyTo":"20070605141208.GA23605@moooo.ath.cx","subject":"Re: [PATCH] filter-branch: prevent filters from reading from stdin","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-05T16:10:13Z","receivedAt":"2007-06-05T16:10:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 5 Jun 2007, Matthias Lederhofer wrote:\n\n> stdin is the list of commits when the env, tree and index\n> filter are executed.  The filters are not supposed to read\n> anything from stdin so the best is to give them /dev/null\n> for reading.\n\nACK. After chatting with Matthias on IRC, I agree that there is more \ndamage than benefit from being able to (accidentally) take stdin in these \nfilters.\n\nCiao,\nDscho\n"}]}