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

Re: [PATCH v2 3/3] make git push --dry-run --porcelain exit with status 0 even if updates will be rejected

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Feb 5, 2010, 23:50 UTC
Message-ID
<20100206075025.c1fe6b5a.rctay89@gmail.com>
In-Reply-To
<cea7001d626116d76d885e24152d68cf41eca4dd.1265402797.git.larry@elder-gods.org>
Hi,
instead of:
Show 16 quoted lines
> diff --git a/transport.c b/transport.c
> index 00d986c..b41e1dc 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -558,8 +558,10 @@ static int fetch_refs_via_pack(struct transport *transport,
>  	return (refs ? 0 : -1);
>  }
>  
> -static int push_had_errors(struct ref *ref)
> +static int push_had_errors(struct ref *ref, int flags)
>  {
> +	if (flags & TRANSPORT_PUSH_DRY_RUN && flags & TRANSPORT_PUSH_PORCELAIN)
> +		return 0;
>  	for (; ref; ref = ref->next) {
>  		switch (ref->status) {
>  		case REF_STATUS_NONE:
and:
Show 9 quoted lines
> @@ -1052,7 +1055,7 @@ int transport_push(struct transport *transport,
>  			flags & TRANSPORT_PUSH_FORCE);
>  
>  		ret = transport->push_refs(transport, remote_refs, flags);
> -		err = push_had_errors(remote_refs);
> +		err = push_had_errors(remote_refs, flags);
>  
>  		ret |= err;
>  
why not:
-->8--
@@ -1049,7 +1052,7 @@ int transport_push(struct transport *transport,
			flags & TRANSPORT_PUSH_FORCE);

		ret = transport->push_refs(transport, remote_refs, flags);
-		err = push_had_errors(remote_refs);
+		err = (pretend && porcelain) ? 0 : push_had_errors(remote_refs);

		ret |= err;

-->8--
-- 
Cheers,
Ray Chuan
Previous: Larry D'AnnaNext: Larry D'Anna
Message 6 of 7 in “[PATCH v2 0/3]”
  1. 0/3 Larry D'Anna, Feb 5, 2010
  2. 1/3 fix an error message in git-push so it goes to stderrLarry D'Anna, Feb 5, 2010
  3. 2/3 clean up some of the output from git push --porcelainLarry D'Anna, Feb 5, 2010
  4. Junio C HamanoFeb 5, 2010
  5. 3/3 make git push --dry-run --porcelain exit with status 0 even if updates will be rejectedLarry D'Anna, Feb 5, 2010
  6. Tay Ray ChuanFeb 5, 2010
  7. Larry D'AnnaFeb 8, 2010

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.