All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: s_shestakov@playrix.com, kostix+git@007spb.ru,
	Matthieu.Moy@grenoble-inp.fr, tboegi@web.de, git@vger.kernel.org
Subject: Re: [PATCH] status: suppress additional warning output in plumbing modes
Date: Sat, 01 Jul 2017 10:35:49 -0700	[thread overview]
Message-ID: <xmqqk23snjpm.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170630162826.27711-1-sbeller@google.com> (Stefan Beller's message of "Fri, 30 Jun 2017 09:28:26 -0700")

Stefan Beller <sbeller@google.com> writes:

> When status is called with '--porcelain' (as implied by '-z'), we promise
> to output only messages as described in the man page.
>
> Suppress CRLF warnings.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>
> Maybe something like this?

This looks to me like a stimulus having enough time to go to the
spinal cord to induce a knee-jerk reaction, without giving a chance
to the brain to think things through.

Surely the reported symptom may have only been about CRLF, but who
says that would be the only kind of warning that would be seen
during "status --porcelain" codepath?

I tend to agree with Ævar's "output for the script can be read from
our standard output" should probably be our first response.

The patch _is_ a good start to document that we may want to do
something differently under _PORCELAIN output modes and one location
in the code that may be a good place to make that decision, but if
we are to squelch the warnings, we should make sure we do not give
any warning, not limited to squelching the safe-crlf warning, to the
standard error, but still diagnose errors and show error messages,
or something like that, I would think.

>
>  builtin/commit.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/builtin/commit.c b/builtin/commit.c
> index 00a01f07c3..3705d5ec6f 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -1126,6 +1126,11 @@ static void finalize_deferred_config(struct wt_status *s)
>  			die(_("--long and -z are incompatible"));
>  	}
>  
> +	/* suppress all additional output in porcelain mode */
> +	if (status_format == STATUS_FORMAT_PORCELAIN ||
> +	    status_format == STATUS_FORMAT_PORCELAIN_V2)
> +		safe_crlf = SAFE_CRLF_FALSE;
> +
>  	if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED)
>  		status_format = status_deferred_config.status_format;
>  	if (status_format == STATUS_FORMAT_UNSPECIFIED)

  parent reply	other threads:[~2017-07-01 17:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  6:00 Bug with automated processing of git status results Сергей Шестаков
2017-06-30  7:12 ` Konstantin Khomoutov
2017-06-30  9:09 ` Matthieu Moy
2017-06-30  9:22   ` Torsten Bögershausen
2017-06-30 16:28     ` [PATCH] status: suppress additional warning output in plumbing modes Stefan Beller
2017-07-01 12:49       ` Torsten Bögershausen
2017-07-01 13:52       ` Ævar Arnfjörð Bjarmason
2017-07-01 17:35       ` Junio C Hamano [this message]
2017-07-05 18:53         ` Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk23snjpm.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=kostix+git@007spb.ru \
    --cc=s_shestakov@playrix.com \
    --cc=sbeller@google.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.