From: Elijah Newren Date: Wed, 25 Mar 2009 21:51:01 +0000 (-0600) Subject: git-filter-branch: avoid collisions with variables in eval'ed commands X-Git-Tag: v1.6.3-rc0~92 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d5b0c97d138201c59b30cb759cedabb70b7bae81;p=git.git git-filter-branch: avoid collisions with variables in eval'ed commands 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 Acked-by: Petr Baudis Signed-off-by: Junio C Hamano --- diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 20f6f5175..b90d3df3a 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -272,10 +272,10 @@ test $commits -eq 0 && die "Found nothing to rewrite" # Rewrite the commits -i=0 +git_filter_branch__commit_count=0 while read commit parents; do - i=$(($i+1)) - printf "\rRewrite $commit ($i/$commits)" + git_filter_branch__commit_count=$(($git_filter_branch__commit_count+1)) + printf "\rRewrite $commit ($git_filter_branch__commit_count/$commits)" case "$filter_subdir" in "")