git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <johannes.sixt@telecom.at>
To: git@vger.kernel.org
Subject: Re: [PATCH] filter-branch: use sh -c instead of eval
Date: Tue, 05 Jun 2007 21:02:18 +0200	[thread overview]
Message-ID: <f44bvq$klu$1@sea.gmane.org> (raw)
In-Reply-To: 20070605165734.GA21708@moooo.ath.cx

Matthias Lederhofer wrote:

> If filters use variables with the same name as variables
> used in the script the script breaks.  Executing the filters
> in a separate process prevents accidential modification of
> the variables in the main process.
> @@ -349,21 +349,21 @@ while read commit; do
>  
>  eval "$(set_ident AUTHOR <../commit)"
>  eval "$(set_ident COMMITTER <../commit)"
> -     eval "$filter_env" < /dev/null
> +     sh -c "$filter_env" < /dev/null

NACK.

The eval is on purpose here. $filter_env must be able export GIT_AUTHOR* and
GIT_COMMITTER* variables here.

Generally, it might be useful that one filter sets or exports variables that
are then available for subsequent filters or the next commit. Therefore, I
think it's actually a feature to have eval instead of sh -c even if there
is a chance that the filter overwrites internal variables. 

-- Hannes

  reply	other threads:[~2007-06-05 19:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 16:57 [PATCH] filter-branch: use sh -c instead of eval Matthias Lederhofer
2007-06-05 19:02 ` Johannes Sixt [this message]
2007-06-06 20:53   ` Junio C Hamano

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='f44bvq$klu$1@sea.gmane.org' \
    --to=johannes.sixt@telecom.at \
    --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).