Subject: Re: [GUILT PATCH 2/5] guilt-guard: Assign guards to patches in series

From: Eric Lesh <[email-masked]>
Date: Thu, 09 Aug 2007 00:34:48 -0700

[ I'm finally back to this.  Thanks for your comments. ]

Josef Sipek <[email-masked]> writes:

[...]

>> +}
>> +
>> +# usage: set_guards <patch> <guards...>
>> +set_guards()
>> +{
>> +	p="$1"
>
> Again, be careful about namespace polution.
>

Can I use "local", or is it a bashism?  If not, use parentheses around
the function body?

>> +	shift
>> +	for x in "$@"; do
>> +		if [ -z $(printf %s "$x" | grep -e "^[+-]") ]; then
>
> Out of curiosity, why printf and not echo?
>

For guards named '-e' or other funky things echo doesn't like and can't
process with echo --.

>> +			echo "'$x' is not a valid guard name"
>> +		else
>> +			sed -i -e "s,^\($p[[:space:]]*.*\)$,\1 #$x," "$series"
>
> The regexp is in double quotes, so you should escape the $ (EOL), as well as
> all the \. Yep, this is shell scripting at its worst.
>

Yikes.

[...]

I'm trying to clean the rest and get it ready again. This whole series
will definitely need to incubate for a while once there's a
reasonable-looking version, to make sure nothing goes crazy.  Hopefully
it ends up being useful somewhere!

	Eric