From: Petr Baudis Date: Wed, 20 Apr 2005 23:21:10 GMT Subject: Re: [PATCH] gittrack.sh accepts invalid branch names Message-ID: <20050420232110.GA12962@pasky.ji.cz> In-Reply-To: <1114026510.15186.15.camel@dv> Dear diary, on Wed, Apr 20, 2005 at 09:48:30PM CEST, I got a letter where Pavel Roskin told me that... > --- a/gittrack.sh > +++ b/gittrack.sh > @@ -35,7 +35,7 @@ die () { > mkdir -p .git/heads > > if [ "$name" ]; then > - grep -q $(echo -e "^$name\t" | sed 's/\./\\./g') .git/remotes || \ > + sed -ne "/^$name\t/p" .git/remotes | grep -q . || \ > [ -s ".git/heads/$name" ] || \ > die "unknown branch \"$name\"" This fixes the acceptance, but not the choice. What does the grep -q . exactly do? Just sets error code based on whether the sed output is non-empty? What about [] instead? -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor