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

Re: [PATCH] git-push: plumb in --mirror mode

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 2, 2007, 12:50 UTC
Message-ID
<Pine.LNX.4.64.0710021347530.28395@racer.site>
In-Reply-To
<20071002120051.GC30636@shadowen.org>
Hi,
On Tue, 2 Oct 2007, Andy Whitcroft wrote:
Show 9 quoted lines
> @@ -137,5 +144,10 @@ int cmd_push(int argc, const char **argv, const char *prefix)
>  	if (all && refspec)
>  		usage(push_usage);
>  
> +	if (modes_specified > 1) {
> +		error("--all and --mirror are incompatible");
> +		usage(push_usage);
> +	}
> +
Why not
	if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR))?
It's more explicit.
Show 9 quoted lines
> @@ -667,6 +673,8 @@ static int git_transport_push(struct transport *transport, int refspec_nr, const
>  		argv[argc++] = "--all";
>  	if (flags & TRANSPORT_PUSH_FORCE)
>  		argv[argc++] = "--force";
> +	if (flags & TRANSPORT_PUSH_MIRROR)
> +		argv[argc++] = "--mirror";
>  	if (data->receivepack) {
>  		char *rp = xmalloc(strlen(data->receivepack) + 16);
>  		sprintf(rp, "--receive-pack=%s", data->receivepack);

Shouldn't you then increment the "11" a few lines before that, to ensure enough space for the new argument?

Ciao, Dscho

Previous: Andy WhitcroftNext: Andy Whitcroft
Message 4 of 5 in “mirror pushing”
  1. Junio C HamanoOct 2, 2007
  2. Andy WhitcroftOct 2, 2007
  3. git-push: plumb in --mirror modeAndy Whitcroft, Oct 2, 2007
  4. Johannes SchindelinOct 2, 2007
  5. Andy WhitcroftOct 2, 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.