git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* lost again on syntax change - local repository?
@ 2005-11-28  2:01 Randal L. Schwartz
  2005-11-28  5:11 ` Junio C Hamano
  2005-11-28 10:48 ` Petr Baudis
  0 siblings, 2 replies; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28  2:01 UTC (permalink / raw)
  To: git


OK, something that I understood broke again. :)
Repeating the steps from my previous attempt to understand repositories,
knowing that cg-push has been updated:

    localhost:~/Projects/Git/Play % cg-admin-setuprepo remote.git
    localhost:~/Projects/Git/Play % mkdir local.git
    localhost:~/Projects/Git/Play % cd local.git
    localhost:..Git/Play/local.git % cg-init -minitial .
    defaulting to local storage area
    Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
    Committed as 6b9850a86bbe2d07bbdaa0c5595c8f4c0423b13c.
    localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"
    localhost:..Git/Play/local.git % cg-branch-ls
    origin  /Users/merlyn/Projects/Git/Play/remote.git#master
    localhost:..Git/Play/local.git % 

At this point, I'm where I was before.  And this next step worked,
although I had to say "origin":

    localhost:..Git/Play/local.git % cg-push
    WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
    WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
    ssh: \033]2;[zsh] localhost: No address associated with nodename
    fatal: unexpected EOF

Uh, say what?  /some/file/foo.git#branch is no longer legal syntax?
Help!

How do I say /some/file on the local filesystem?  (I also tried
file:/some/file, and that didn't work either.)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28  2:01 lost again on syntax change - local repository? Randal L. Schwartz
@ 2005-11-28  5:11 ` Junio C Hamano
  2005-11-28  6:36   ` Alecs King
  2005-11-28 13:04   ` Randal L. Schwartz
  2005-11-28 10:48 ` Petr Baudis
  1 sibling, 2 replies; 14+ messages in thread
From: Junio C Hamano @ 2005-11-28  5:11 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

merlyn@stonehenge.com (Randal L. Schwartz) writes:

> At this point, I'm where I was before.  And this next step worked,
> although I had to say "origin":
>
>     localhost:..Git/Play/local.git % cg-push
>     WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
>     WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
>     ssh: \033]2;[zsh] localhost: No address associated with nodename
>     fatal: unexpected EOF
>
> Uh, say what?  /some/file/foo.git#branch is no longer legal syntax?
> Help!

If it is not absolutely necessary that you need to use Cogito,
IOW, if git barebone Porcelains are good enough for your use,
the following may be adequate.

	$ echo >.git/remotes/origin <<EOF
	URL: /path/to/remote.git/
        Push: master
        Pull: master:origin
        EOF
	$ git push origin

I said "may be" because I do not understand the sequence before
"At this point"; how your local.git is initially set up to
relate to the remoge.git.  I do not see local.git being created
by cloning remote.git.  But modulo that the above should work
fine; I do that as a cheap backup on my local machine.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28  5:11 ` Junio C Hamano
@ 2005-11-28  6:36   ` Alecs King
  2005-11-28 13:04   ` Randal L. Schwartz
  1 sibling, 0 replies; 14+ messages in thread
From: Alecs King @ 2005-11-28  6:36 UTC (permalink / raw)
  To: git

On Sun, Nov 27, 2005 at 09:11:37PM -0800, Junio C Hamano wrote:
> 	$ echo >.git/remotes/origin <<EOF
          ^^^^ you probably meant 'cat'. :)
> 	URL: /path/to/remote.git/
>         Push: master
>         Pull: master:origin
>         EOF
> 	$ git push origin

-- 
Alecs King

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28  2:01 lost again on syntax change - local repository? Randal L. Schwartz
  2005-11-28  5:11 ` Junio C Hamano
@ 2005-11-28 10:48 ` Petr Baudis
  2005-11-28 13:09   ` Randal L. Schwartz
  1 sibling, 1 reply; 14+ messages in thread
From: Petr Baudis @ 2005-11-28 10:48 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

Dear diary, on Mon, Nov 28, 2005 at 03:01:18AM CET, I got a letter
where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...
>     localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"

BTW, it should be fine to just say ../remote.git#master.

>     localhost:..Git/Play/local.git % cg-branch-ls
>     origin  /Users/merlyn/Projects/Git/Play/remote.git#master
>     localhost:..Git/Play/local.git % 
> 
> At this point, I'm where I was before.  And this next step worked,
> although I had to say "origin":
> 
>     localhost:..Git/Play/local.git % cg-push
>     WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
>     WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
>     ssh: \033]2;[zsh] localhost: No address associated with nodename
>     fatal: unexpected EOF

I did the exact same sequence of commands and everything works just fine
for me with both the latest master and the latest v0.16. What Cogito
version do you use? Are you sure the origin location is just the local
path at the time of cg-push?

-- 
				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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28  5:11 ` Junio C Hamano
  2005-11-28  6:36   ` Alecs King
@ 2005-11-28 13:04   ` Randal L. Schwartz
  1 sibling, 0 replies; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28 13:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

>>>>> "Junio" == Junio C Hamano <junkio@cox.net> writes:

Junio> If it is not absolutely necessary that you need to use Cogito,
Junio> IOW, if git barebone Porcelains are good enough for your use,
Junio> the following may be adequate.

Well, then, you should get rid of cogito/Documentation/introduction.html,
if you don't plan on supporting the interfaces described there.

I'm really just starting out. I see that tutorial, and I want to do it.

Junio> 	$ echo >.git/remotes/origin <<EOF
Junio> 	URL: /path/to/remote.git/
Junio>         Push: master
Junio>         Pull: master:origin
Junio>         EOF

Ugh, ugh ugh ugh.

Junio> 	$ git push origin

Junio> I said "may be" because I do not understand the sequence before
Junio> "At this point"; how your local.git is initially set up to
Junio> relate to the remoge.git.  I do not see local.git being created
Junio> by cloning remote.git.

I can't, because I have to do the first push.  This is what I was told
last time!

I'm doing what I'm told, and now more things are breaking.  This is
frustrating.

I'm not saying that you guys aren't doing a hell of a job.  I'm just
coming at this from a user's perspective, and trying to describe it to
others.  I'm not comfortable yet, because every time I try to do what
the manuals say, it breaks.  Perhaps y'all are secretly working around
every broken thing, but I don't know enough to do that.

Junio>   But modulo that the above should work
Junio> fine; I do that as a cheap backup on my local machine.

So, give me the exact steps, using "cg" to:

        create a "remote" repo on my disk
        create a "local" repo on my disk
        set up the linkage between remote and local
        push from local to remote
        pull from remote to local

And if it ever needs a command like "cat" or "echo", something is
wrong.  I'll accept a "git-" command for one or two of the steps, but
that feels like dropping into assembler instead of C.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 10:48 ` Petr Baudis
@ 2005-11-28 13:09   ` Randal L. Schwartz
  2005-11-28 13:41     ` Petr Baudis
  0 siblings, 1 reply; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28 13:09 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

>>>>> "Petr" == Petr Baudis <pasky@suse.cz> writes:

Petr> Dear diary, on Mon, Nov 28, 2005 at 03:01:18AM CET, I got a letter
Petr> where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...
>> localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"

Petr> BTW, it should be fine to just say ../remote.git#master.

Maybe this is why yours worked.

Ahh, yes, it did.

So, cg-push treats '../..' differently from '/foo/bar/...'.

This is bad.  That's the bug.

cg-push treats "../" as a local filesystem, and "/..." as git-ssh.
This is a change from before.

Please make it recognize "/..." as a local file again.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 13:09   ` Randal L. Schwartz
@ 2005-11-28 13:41     ` Petr Baudis
  2005-11-28 13:45       ` Randal L. Schwartz
  0 siblings, 1 reply; 14+ messages in thread
From: Petr Baudis @ 2005-11-28 13:41 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

Dear diary, on Mon, Nov 28, 2005 at 02:09:40PM CET, I got a letter
where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...
> >>>>> "Petr" == Petr Baudis <pasky@suse.cz> writes:
> 
> Petr> Dear diary, on Mon, Nov 28, 2005 at 03:01:18AM CET, I got a letter
> Petr> where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...
> >> localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"
> 
> Petr> BTW, it should be fine to just say ../remote.git#master.
> 
> Maybe this is why yours worked.
> 
> Ahh, yes, it did.
> 
> So, cg-push treats '../..' differently from '/foo/bar/...'.
> 
> This is bad.  That's the bug.

Nope, the relative path is resolved at the time of adding the branch.
Check for yourself:

xpasky@machine[0:0]~/git-devel/x/local.git$ cg-branch-add origin "$(cd ..; pwd)/remote.git#master"
xpasky@machine[0:0]~/git-devel/x/local.git$ cg-branch-add origin2 ../remote.git#master
xpasky@machine[0:0]~/git-devel/x/local.git$ cg-branch-ls
origin  /home/xpasky/git-devel/x/remote.git#master
origin2 /home/xpasky/git-devel/x/remote.git#master

Pushing to both works fine.

> cg-push treats "../" as a local filesystem, and "/..." as git-ssh.
> This is a change from before.
> 
> Please make it recognize "/..." as a local file again.

It would sure be bad if this was the case. However I'm really sorry, but
I still can't reproduce it.

-- 
				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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 13:41     ` Petr Baudis
@ 2005-11-28 13:45       ` Randal L. Schwartz
  2005-11-28 13:59         ` Randal L. Schwartz
  2005-11-28 14:34         ` Petr Baudis
  0 siblings, 2 replies; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28 13:45 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

>>>>> "Petr" == Petr Baudis <pasky@suse.cz> writes:

Petr> It would sure be bad if this was the case. However I'm really sorry, but
Petr> I still can't reproduce it.

Reproduce by this:

    localhost:~/Projects/Git/Play % cg-admin-setuprepo remote.git
    localhost:~/Projects/Git/Play % mkdir local.git
    localhost:~/Projects/Git/Play % cd local.git
    localhost:..Git/Play/local.git % cg-init -minitial
    defaulting to local storage area
    Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
    Committed as 958ed484382609786ca9ae611cc54802cb7697a9.
    localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"           
    localhost:..Git/Play/local.git % cg-push
    WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
    WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
    ssh: \033]2;[zsh] localhost: No address associated with nodename
    fatal: unexpected EOF

I did this with current-of-the-moment git and cogito:

localhost:~ % cd MIRROR/git-GIT 
localhost:~/MIRROR/git-GIT % cg-status
Heads:
   >master      f1f909e3185b5ee366e198042447afe749bfc813
  R origin      f1f909e3185b5ee366e198042447afe749bfc813

localhost:~ % cd MIRROR/cogito-GIT 
localhost:~/MIRROR/cogito-GIT % cg-status
Heads:
   >master      cec6c5564c6dcc30361f164dce9ac5dc635d202f
  R origin      cec6c5564c6dcc30361f164dce9ac5dc635d202f

If this indeed works on your machine, then we have a Darwin dependency
somewhere in cg-push or something it calls.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 13:45       ` Randal L. Schwartz
@ 2005-11-28 13:59         ` Randal L. Schwartz
  2005-11-28 14:34         ` Petr Baudis
  1 sibling, 0 replies; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28 13:59 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

>>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:

Randal>     localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"           
Randal>     localhost:..Git/Play/local.git % cg-push
Randal>     WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
Randal>     WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
Randal>     ssh: \033]2;[zsh] localhost: No address associated with nodename
Randal>     fatal: unexpected EOF

Oh, and make sure ssh is *off* on your machine.  You might be getting
it to work by ssh'ing back to your own box.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 13:45       ` Randal L. Schwartz
  2005-11-28 13:59         ` Randal L. Schwartz
@ 2005-11-28 14:34         ` Petr Baudis
  2005-11-28 14:46           ` Randal L. Schwartz
  1 sibling, 1 reply; 14+ messages in thread
From: Petr Baudis @ 2005-11-28 14:34 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

Dear diary, on Mon, Nov 28, 2005 at 02:45:24PM CET, I got a letter
where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...
> >>>>> "Petr" == Petr Baudis <pasky@suse.cz> writes:
> 
> Petr> It would sure be bad if this was the case. However I'm really sorry, but
> Petr> I still can't reproduce it.
> 
> Reproduce by this:
> 
>     localhost:~/Projects/Git/Play % cg-admin-setuprepo remote.git
>     localhost:~/Projects/Git/Play % mkdir local.git
>     localhost:~/Projects/Git/Play % cd local.git
>     localhost:..Git/Play/local.git % cg-init -minitial
>     defaulting to local storage area
>     Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
>     Committed as 958ed484382609786ca9ae611cc54802cb7697a9.
>     localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"           
>     localhost:..Git/Play/local.git % cg-push
>     WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
>     WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
>     ssh: \033]2;[zsh] localhost: No address associated with nodename
>     fatal: unexpected EOF

Still works for me.

Could you patch cg-push like

diff --git a/cg-push b/cg-push
index 1d59422..bdab3b8 100755
--- a/cg-push
+++ b/cg-push
@@ -47,6 +47,7 @@ name=${ARGS[0]}
 [ "$name" ] || { [ -s $_git/branches/origin ] && name=origin; }
 [ "$name" ] || die "where to push to?"
 uri=$(cat "$_git/branches/$name" 2>/dev/null) || die "unknown branch: $name"
+echo "using $uri"
 
 rembranch=master
 sprembranch=
@@ -54,6 +55,7 @@ if echo "$uri" | grep -q '#'; then
 	rembranch=$(echo $uri | cut -d '#' -f 2)
 	sprembranch=":$rembranch"
 	uri=$(echo $uri | cut -d '#' -f 1)
+	echo "now using $uri"
 fi
 
 if echo "$uri" | grep -q "^http://"; then
@@ -63,6 +65,7 @@ elif echo "$uri" | grep -q "^git+ssh://"
 elif echo "$uri" | grep -q "^rsync://"; then
         die "pushing over rsync not supported"
 elif echo "$uri" | grep -q ":"; then
+	echo "matched ':' in $uri ?!"
 	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[@]}"

please?

(We are a bit careless about quoting here, which I will fix now,
but that shouldn't be the problem.)

-- 
				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.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 14:34         ` Petr Baudis
@ 2005-11-28 14:46           ` Randal L. Schwartz
  2005-11-28 19:15             ` Petr Baudis
  0 siblings, 1 reply; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28 14:46 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

>>>>> "Petr" == Petr Baudis <pasky@suse.cz> writes:

Petr> Could you patch cg-push like
[yes]

Here's the result:

    localhost:~/Projects/git/Play % rm -rf *git
    localhost:~/Projects/git/Play % cg-admin-setuprepo remote.git
    localhost:~/Projects/git/Play % mkdir local.git
    localhost:~/Projects/git/Play % cd local.git
    localhost:..git/Play/local.git % cg-init -minitial
    defaulting to local storage area
    Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
    Committed as 06223ad471c4f1c60da364310d1dd71a91310346.
    localhost:..git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"              
    localhost:..git/Play/local.git % cg-branch-ls
    origin  /Users/merlyn/Projects/git/Play/remote.git#master
    localhost:..git/Play/local.git % cg-push
    using /Users/merlyn/Projects/git/Play/remote.git#master
    now using /Users/merlyn/Projects/git/Play/remote.git
    matched ':' in '/Users/merlyn/Projects/git/Play/remote.git'?
    WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
    WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
    ssh: \033]2;[zsh] localhost: No address associated with nodename
    fatal: unexpected EOF

Well, that's curious, eh?

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.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 14:46           ` Randal L. Schwartz
@ 2005-11-28 19:15             ` Petr Baudis
  2005-11-28 19:25               ` Randal L. Schwartz
  0 siblings, 1 reply; 14+ messages in thread
From: Petr Baudis @ 2005-11-28 19:15 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

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...
> 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.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 19:15             ` Petr Baudis
@ 2005-11-28 19:25               ` Randal L. Schwartz
  2005-11-28 20:53                 ` Petr Baudis
  0 siblings, 1 reply; 14+ messages in thread
From: Randal L. Schwartz @ 2005-11-28 19:25 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

>>>>> "Petr" == Petr Baudis <pasky@suse.cz> writes:

Petr> Could you try the following, please?

Petr> diff --git a/cg-push b/cg-push
Petr> index 1d59422..323ef26 100755
Petr> --- a/cg-push
Petr> +++ b/cg-push
Petr> @@ -56,13 +56,13 @@ if echo "$uri" | grep -q '#'; then
Petr>  	uri=$(echo $uri | cut -d '#' -f 1)
Petr>  fi
 
Petr> -if echo "$uri" | grep -q "^http://"; then
Petr> +if [ "${uri#http://}" != "$uri" ]; then
Petr>  	die "pushing over HTTP not supported yet"
Petr> -elif echo "$uri" | grep -q "^git+ssh://"; then
Petr> +elif [ "${uri#git+ssh://}" != "$uri" ]; then
Petr>  	send_pack_update "$name" "$(echo "$uri" | sed 's#^git+ssh://\([^/]*\)\(/.*\)$#\1:\2#')" $_git_head$sprembranch "${tags[@]}"
Petr> -elif echo "$uri" | grep -q "^rsync://"; then
Petr> +elif [ "${uri#rsync://}" != "$uri" ]; then
Petr>          die "pushing over rsync not supported"
Petr> -elif echo "$uri" | grep -q ":"; then
Petr> +elif [ "${uri#*:}" != "$uri" ]; then
Petr>  	echo "WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol."
Petr>  	echo "WARNING: The host:path syntax is evil because it is implicit. Please just use a URI."
Petr>  	send_pack_update "$name" "$uri" $_git_head$sprembranch "${tags[@]}"

Bizarrely, same behavior.  Mark me "puzzled".

    localhost:~/Projects/Git/Play % cg-admin-setuprepo remote.git        
    localhost:~/Projects/Git/Play % mkdir local.git
    localhost:~/Projects/Git/Play % cd local.git 
    localhost:..Git/Play/local.git % cg-init -mempty
    defaulting to local storage area
    Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
    Committed as ee28097d96063ae660faf325f5bffdbcbc6818f4.
    localhost:..Git/Play/local.git % cg-branch-add origin "$(cd ..; pwd)/remote.git#master"           
    localhost:..Git/Play/local.git % cg-branch-ls   
    origin  /Users/merlyn/Projects/Git/Play/remote.git#master
    localhost:..Git/Play/local.git % cg-push
    WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
    WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
    ssh: \033]2;[zsh] localhost: No address associated with nodename
    fatal: unexpected EOF
    localhost:..Git/Play/local.git % which cg-push
    /opt/git/bin/cg-push
    localhost:..Git/Play/local.git % grep uri $(which cg-push)
    uri=$(cat "$_git/branches/$name" 2>/dev/null) || die "unknown branch: $name"
    if echo "$uri" | grep -q '#'; then
            rembranch=$(echo $uri | cut -d '#' -f 2)
            uri=$(echo $uri | cut -d '#' -f 1)
    if [ "${uri#http://}" != "$uri" ]; then
    elif [ "${uri#git+ssh://}" != "$uri" ]; then
            send_pack_update "$name" "$(echo "$uri" | sed 's#^git+ssh://\([^/]*\)\(/.*\)$#\1:\2#')" $_git_head$sprembranch "${tags[@]}"
    elif [ "${uri#rsync://}" != "$uri" ]; then
    elif [ "${uri#*:}" != "$uri" ]; then
            send_pack_update "$name" "$uri" $_git_head$sprembranch "${tags[@]}"
            remgit="$uri"; [ -d "$remgit/.git" ] && remgit="$remgit/.git"
                    send_pack_update "$name" "$uri" $_git_head$sprembranch "${tags[@]}"


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: lost again on syntax change - local repository?
  2005-11-28 19:25               ` Randal L. Schwartz
@ 2005-11-28 20:53                 ` Petr Baudis
  0 siblings, 0 replies; 14+ messages in thread
From: Petr Baudis @ 2005-11-28 20:53 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

Dear diary, on Mon, Nov 28, 2005 at 08:25:06PM CET, I got a letter
where "Randal L. Schwartz" <merlyn@stonehenge.com> said that...
>     localhost:..Git/Play/local.git % cg-push
>     WARNING: I guessed the host:path syntax was used and fell back to the git+ssh protocol.
>     WARNING: The host:path syntax is evil because it is implicit. Please just use a URI.
>     ssh: \033]2;[zsh] localhost: No address associated with nodename
>     fatal: unexpected EOF

Could you please strace it, to see what argument does git-send-pack
take? (Or hijack git-send-pack if you cannot strace on your system.)

-- 
				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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-11-28 20:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-28  2:01 lost again on syntax change - local repository? Randal L. Schwartz
2005-11-28  5:11 ` Junio C Hamano
2005-11-28  6:36   ` Alecs King
2005-11-28 13:04   ` Randal L. Schwartz
2005-11-28 10:48 ` Petr Baudis
2005-11-28 13:09   ` Randal L. Schwartz
2005-11-28 13:41     ` Petr Baudis
2005-11-28 13:45       ` Randal L. Schwartz
2005-11-28 13:59         ` Randal L. Schwartz
2005-11-28 14:34         ` Petr Baudis
2005-11-28 14:46           ` Randal L. Schwartz
2005-11-28 19:15             ` Petr Baudis
2005-11-28 19:25               ` Randal L. Schwartz
2005-11-28 20:53                 ` Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).