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

Re: [PATCH v2 2/3] clean up some of the output from git push --porcelain

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 5, 2010, 21:07 UTC
Message-ID
<7vpr4j1jeq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<ec0db70b8166ee4093a5a2400cd592e4263db20b.1265402797.git.larry@elder-gods.org>
Larry D'Anna <larry@elder-gods.org> writes:
Show 10 quoted lines
> diff --git a/builtin-push.c b/builtin-push.c
> index 0a27072..ff0b1c6 100644
> --- a/builtin-push.c
> +++ b/builtin-push.c
> @@ -123,7 +123,7 @@ static int push_with_options(struct transport *transport, int flags)
>  	if (!err)
>  		return 0;
>  
> -	if (nonfastforward && advice_push_nonfastforward) {
> +	if (!(flags & TRANSPORT_PUSH_PORCELAIN) && nonfastforward && advice_push_nonfastforward) {

I suspect that it would be a much nicer solution if you turned advice_* off in very early parts of the codepath after you read configuration and command line options to see if --porcelain was asked for. That way, we don't have to add code check for PORCELAIN next time we add code for new kinds of advice. People who are adding new advice_* would grep for existing one (e.g. "advice_push_nonfastforward") and will notice this line, but if you had

	if (flags & TRANSPORT_PUSH_PORDCELAIN) {
        	advice_push_nonfastforward = 0;
	}

in early parts of the code, they will notice that as well, and then they know where to add the corresponding change necessary.

Previous: Larry D'AnnaNext: Larry D'Anna
Message 4 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.