# pushing fails - WHY?

3 messages from 2006-10-01 to 2006-10-02. Participants: Alan Chandler, Junio C Hamano.
Thread: https://gitlist.dev/t/5775

## Alan Chandler, 2006-10-01 10:38

Subject: pushing fails - WHY?
Message-ID: <200610011138.06823.alan@chandlerfamily.org.uk>
URL: https://gitlist.dev/e/200610011138.06823.alan%40chandlerfamily.org.uk

```
I am just coming back to repeat the setting up of my public git repositories 
after loosing them in a disk crash a little while ago.

The first repository I am setting up is called akclib on server roo.home

so in /var/lib/git on that machine I did

mkdir akclib.git
GIT_DIR akclib.git git init-db --shared

Back on my workstation where my master repository resides

~/dev/akcmoney

I have a .git/remotes/public file which contains

URL:roo.home:/var/lib/git/akclib.git
Push:master

BUT WHEN I attempt to push -  thus

alan@kanger:~/dev/akclib[master]$ git push public
fatal: remote 'public' has no URL

It fails.  But I don't understand why. Can someone point me at what I am doing 
wrong.

(git is version 1.4.2.1 on the workstation, 1.4.1 on the server)

-- 
Alan Chandler
http://www.chandlerfamily.org.uk

```

## Alan Chandler, 2006-10-01 11:53

Subject: ANSWER
Message-ID: <200610011253.03169.alan@chandlerfamily.org.uk>
URL: https://gitlist.dev/e/200610011253.03169.alan%40chandlerfamily.org.uk
In-Reply-To: <200610011138.06823.alan@chandlerfamily.org.uk>

```
On Sunday 01 October 2006 11:38, Alan Chandler wrote:

> I have a .git/remotes/public file which contains
>
> URL:roo.home:/var/lib/git/akclib.git
> Push:master

The URL: and Push: need spaces before the detail

This used to work, so somewhere along the line (when the builtin was 
introduced?) the need for the space has arisen.

The documentation, although showing the space is not very clear about it.

-- 
Alan Chandler
http://www.chandlerfamily.org.uk

```

## Junio C Hamano, 2006-10-02 07:40

Subject: Re: ANSWER
Message-ID: <7v7izjxj1r.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v7izjxj1r.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <200610011253.03169.alan@chandlerfamily.org.uk>

```
Alan Chandler <alan@chandlerfamily.org.uk> writes:

> On Sunday 01 October 2006 11:38, Alan Chandler wrote:
>
>> I have a .git/remotes/public file which contains
>>
>> URL:roo.home:/var/lib/git/akclib.git
>> Push:master
>
> The URL: and Push: need spaces before the detail
>
> This used to work, so somewhere along the line (when the builtin was 
> introduced?) the need for the space has arisen.

True.  I did not notice it before but this indeed is a breakage
when builtin-push.c was done.

Totally untested, but it looks obvious enough...

-- >8 --
git-push: .git/remotes/ file does not require SP after colon

Although most people would have one after colon if only for
readability, we never required it in git-parse-remote, so let's
not require one only in git-push.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/builtin-push.c b/builtin-push.c
index c43f256..f5150ed 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -78,12 +78,12 @@ static int get_remotes_uri(const char *r
 		int is_refspec;
 		char *s, *p;
 
-		if (!strncmp("URL: ", buffer, 5)) {
+		if (!strncmp("URL:", buffer, 4)) {
 			is_refspec = 0;
-			s = buffer + 5;
-		} else if (!strncmp("Push: ", buffer, 6)) {
+			s = buffer + 4;
+		} else if (!strncmp("Push:", buffer, 5)) {
 			is_refspec = 1;
-			s = buffer + 6;
+			s = buffer + 5;
 		} else
 			continue;
 

```
