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

From: Petr Baudis <[email-masked]>
Date: Wed, 25 Mar 2009 22:58:48 +0100

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 <[email-masked]> wrote:
> > On Wed, Mar 25, 2009 at 03:13:01PM -0600, [email-masked] wrote:
> >> From: Elijah Newren <[email-masked]>
> >>
> >> 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 <[email-masked]>
> >
> > Almost-acked-by: Petr Baudis <[email-masked]>
> >
> > 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.

-- 
				Petr "Pasky" Baudis
The average, healthy, well-adjusted adult gets up at seven-thirty
in the morning feeling just terrible. -- Jean Kerr