From: Matthias Urlichs Date: Wed, 21 Sep 2005 07:33:15 GMT Subject: Re: [PATCH] cg-diff fixed to work with BSD xargs Message-ID: In-Reply-To: <11253960093915-git-send-email-martin@catalyst.net.nz> Hi, Martin Langhoff wrote: > Calls to cg-diff without filename parameters were dependent on GNU xargs > traits. I don't know what drugs your shell was on when you tested this (assuming that you did ;-) but this patch is wrong -- your test always succeeds, due to the vagaries of test / [ ] semantics. > - cat $filter | xargs git-diff-cache -r -p $tree | colorize | pager > + if [ -s $filter ]; then > + cat $filter | xargs git-diff-cache -r -p $tree | colorize | pager > + else > + git-diff-cache -r -p $tree | colorize | pager > + fi > $ foo="" $ [ -s $foo ] $ echo $? 0 $ [ -s "$foo" ] $ echo $? 1 $ -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de - - God made pot. Man made beer. Who do you trust?