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

Re: lost again on syntax change - local repository?

From
Petr Baudis <pasky@suse.cz>
Date
Nov 28, 2005, 19:15 UTC
Message-ID
<20051128191546.GT22159@pasky.or.cz>
In-Reply-To
<868xv86dam.fsf@blue.stonehenge.com>

Dear diary, on Mon, Nov 28, 2005 at 03:46:09PM CET, I got a letter where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...

Show 13 quoted lines
> However, I get this:
> 
>     localhost:..git/Play/local.git % echo "/Users/merlyn/Projects/git/Play/remote.git" | grep -q ":"
>     localhost:..git/Play/local.git % echo $status
>     1
> 
> So, perhaps the "bash" on this system is broken for that elif chain?
> 
> localhost:..git/Play/local.git % bash --version
> GNU bash, version 2.05b.0(1)-release (powerpc-apple-darwin8.0)
> Copyright (C) 2002 Free Software Foundation, Inc.
> 
> Gah.  Yet Another Hidden Dependency.
Perplexing. Can't reproduce it with bash-2.05b either.
Could you try the following, please?
diff --git a/cg-push b/cg-push
index 1d59422..323ef26 100755
--- a/cg-push
+++ b/cg-push
@@ -56,13 +56,13 @@ if echo "$uri" | grep -q '#'; then
 	uri=$(echo $uri | cut -d '#' -f 1)
 fi
 
-if echo "$uri" | grep -q "^http://"; then
+if [ "${uri#http://}" != "$uri" ]; then
 	die "pushing over HTTP not supported yet"
-elif echo "$uri" | grep -q "^git+ssh://"; then
+elif [ "${uri#git+ssh://}" != "$uri" ]; then
 	send_pack_update "$name" "$(echo "$uri" | sed 's#^git+ssh://\([^/]*\)\(/.*\)$#\1:\2#')" $_git_head$sprembranch "${tags[@]}"
-elif echo "$uri" | grep -q "^rsync://"; then
+elif [ "${uri#rsync://}" != "$uri" ]; then
         die "pushing over rsync not supported"
-elif echo "$uri" | grep -q ":"; then
+elif [ "${uri#*:}" != "$uri" ]; then
 	echo "WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol."
 	echo "WARNING: The host:path syntax is evil because it is implicit. Please just use a URI."
 	send_pack_update "$name" "$uri" $_git_head$sprembranch "${tags[@]}"
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Previous: Randal L. SchwartzNext: Randal L. Schwartz
Message 12 of 14 in “lost again on syntax change - local repository?”
  1. Randal L. SchwartzNov 28, 2005
  2. Junio C HamanoNov 28, 2005
  3. Alecs KingNov 28, 2005
  4. Randal L. SchwartzNov 28, 2005
  5. Petr BaudisNov 28, 2005
  6. Randal L. SchwartzNov 28, 2005
  7. Petr BaudisNov 28, 2005
  8. Randal L. SchwartzNov 28, 2005
  9. Randal L. SchwartzNov 28, 2005
  10. Petr BaudisNov 28, 2005
  11. Randal L. SchwartzNov 28, 2005
  12. Petr BaudisNov 28, 2005
  13. Randal L. SchwartzNov 28, 2005
  14. Petr BaudisNov 28, 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.