git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] filter-branch: use sh -c instead of eval

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 6, 2007, 20:53 UTC
Message-ID
<7vd508ztwj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<f44bvq$klu$1@sea.gmane.org>
Johannes Sixt <johannes.sixt@telecom.at> writes:
Show 17 quoted lines
> 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.
True.  The other hunks may be improvements, though.
Previous: Johannes Sixt
Message 3 of 3 in “filter-branch: use sh -c instead of eval”
  1. filter-branch: use sh -c instead of evalMatthias Lederhofer, Jun 5, 2007
  2. Johannes SixtJun 5, 2007
  3. Junio C HamanoJun 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.