[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] guilt: add option guilt.diffstat
From:       "Boyd Stephen Smith Jr." <bss03 () volumehost ! net>
Date:       2008-12-13 6:18:50
Message-ID: 200812130018.56061.bss03 () volumehost ! net
[Download RAW message or body]

On Friday 2008 December 12 22:43:57 Josef Jeff Sipek wrote:
>> +		if [ -n "$5" -o "x$diffstat" = "x1" ]; then
>
>Why the 'x' thing? I've seen it is some scripts before, but I can't think of
>a reason to use it if the variable is surrounded in quotation marks.

'[' or test see the arguments after they are unquoted (normally).  So, 
if "$diffstat" is "-n" it might try and do the -n test, rather than the = 
test.

It could be re-written as "1" == "${diffstat}" instead to avoid the x, but 
it's not a big deal (to me).  That also looks backwards to a lot of people.
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss03@volumehost.net                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.org/                      \_/     

["signature.asc" (application/pgp-signature)]
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic