Subject: Re: [PATCH] bash completion: Support "unpushed commits" warnings in __git_ps1

From: Andrew Sayers <[email-masked]>
Date: Sun, 06 Jun 2010 23:19:11 +0100

On 06/06/10 22:07, Jakub Narebski wrote:
> 
> What disallowed ${} constructs?

My mistake, I misread that part of CodingGuidelines.  The following
bash-specific implementation takes about 0.013 seconds:

BRANCH=( $( git log --first-parent -1 \
		--grep="^git-svn-id: $remote_branch" ) )
BRANCH=${BRANCH[ ${#BRANCH[@]} - 2 ]}
BRANCH=${BRANCH%@*}
BRANCH=${BRANCH#*$remote_branch/}

Using an array here saves about 0.001 of a second.

	- Andrew