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

Re: ANSWER

From
Junio C Hamano <junkio@cox.net>
Date
Oct 2, 2006, 07:40 UTC
Message-ID
<7v7izjxj1r.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200610011253.03169.alan@chandlerfamily.org.uk>
Alan Chandler <alan@chandlerfamily.org.uk> writes:
Show 11 quoted lines
> 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;
 
Previous: Alan Chandler
Message 3 of 3 in “pushing fails - WHY?”
  1. Alan ChandlerOct 1, 2006
  2. ANSWERAlan Chandler, Oct 1, 2006
  3. Junio C HamanoOct 2, 2006

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.