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

Re: [PATCH 1/3] Move remote parsing into a library file out of builtin-push.

From
Junio C Hamano <junkio@cox.net>
Date
May 12, 2007, 07:51 UTC
Message-ID
<7v3b225vkj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0705112238260.18541@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> The new parser is different from the one in builtin-push in two ways:
> the default is to use the current branch's remote, if there is one,
> before "origin"; and config is used in preference to remotes.

Please chuck my comment about describing differences in the previous message---you did it already. Sorry.

Show 15 quoted lines
> diff --git a/remote.c b/remote.c
> new file mode 100644
> index 0000000..1dd2e77
> --- /dev/null
> +++ b/remote.c
> @@ -0,0 +1,203 @@
> +#include "cache.h"
> +#include "remote.h"
> +#include "refs.h"
> +
> +static struct remote **remotes;
> +static int allocated_remotes;
> +
> +#define BUF_SIZE (2084)
> +static char buffer[BUF_SIZE];

Heh, inherited a funny constant from the original... I guess most likely he meant 2048 ;-).

Show 10 quoted lines
> +static void read_remotes_file(struct remote *remote)
> +{
> +	FILE *f = fopen(git_path("remotes/%s", remote->name), "r");
> +
> +	if (!f)
> +		return;
> +	while (fgets(buffer, BUF_SIZE, f)) {
> +...
> +	}
> +}
I sense a slight "FILE *" leak here...
Previous: Daniel Barkalow
Message 2 of 2 in “Move remote parsing into a library file out of builtin-push.”
  1. 1/3 Move remote parsing into a library file out of builtin-push.Daniel Barkalow, May 12, 2007
  2. Junio C HamanoMay 12, 2007

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.