git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gittrack.sh accepts invalid branch names

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 20, 2005, 23:21 UTC
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 <proski@gnu.org> told me that...

Show 10 quoted lines
> --- 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
Previous: Pavel RoskinNext: Pavel Roskin
Message 2 of 4 in “gittrack.sh accepts invalid branch names”
  1. gittrack.sh accepts invalid branch namesPavel Roskin, Apr 20, 2005
  2. Petr BaudisApr 20, 2005
  3. Pavel RoskinApr 21, 2005
  4. Paul JacksonApr 20, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.