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

Re: [PATCH] git-filter-branch: avoid collisions with variables in eval'ed commands

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2009, 23:34 UTC
Message-ID
<7vskl1w50i.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090325215848.GV8940@machine.or.cz>
Petr Baudis <pasky@suse.cz> writes:
Show 32 quoted lines
> On Wed, Mar 25, 2009 at 03:33:31PM -0600, Elijah Newren wrote:
>> Hi,
>> 
>> On Wed, Mar 25, 2009 at 3:24 PM, Petr Baudis <pasky@suse.cz> wrote:
>> > On Wed, Mar 25, 2009 at 03:13:01PM -0600, newren@gmail.com wrote:
>> >> From: Elijah Newren <newren@gmail.com>
>> >>
>> >> Avoid using simple variable names like 'i', since user commands are eval'ed
>> >> and may clash with and overwrite our values.
>> >>
>> >> Signed-off-by: Elijah Newren <newren@gmail.com>
>> >
>> > Almost-acked-by: Petr Baudis <pasky@suse.cz>
>> >
>> > But:
>> >
>> >>-i=0
>> >>+git_filter_branch_count=0
>> >
>> > Why branch_count? It counts commits, not branches, doesn't it?
>> 
>> Oh, I was just changing i->git_filter_branch_i, then thought as long
>> as it was long I might as well use a word instead of "i".  Didn't
>> think about the combined meaning.  How about
>> "git_filter_branch_commit_count"?  Maybe a double underscore between
>> the "namespace" and the "variable"?
>
> Oh, I sort of thought it's "git-filter branch count", not
> "git-filter-branch count". I'm dumbed down from all day spent in IKEA
> I guess. :/
>
> I'd personally just use $__git_i, $__git_commit or something, but YMMV.
Heh, I'll drop lmost-a from your earlier message and commit the result.
Thanks.
Previous: Petr Baudis
Message 6 of 6 in “git-filter-branch: avoid collisions with variables in eval'ed commands”
  1. git-filter-branch: avoid collisions with variables in eval'ed commandsnewren@gmail.com, Mar 25, 2009
  2. Petr BaudisMar 25, 2009
  3. Elijah NewrenMar 25, 2009
  4. newren@gmail.comMar 25, 2009
  5. Petr BaudisMar 25, 2009
  6. Junio C HamanoMar 25, 2009

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.