git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git clone silently aborts if stdout gets a broken pipe
Date: Wed, 18 Sep 2013 16:01:52 -0400	[thread overview]
Message-ID: <20130918200152.GA17074@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqmwnaudtg.fsf@gitster.dls.corp.google.com>

On Wed, Sep 18, 2013 at 12:31:23PM -0700, Junio C Hamano wrote:

> > Hrm, this actually breaks t5701, which expects "clone 2>err" to print
> > nothing to stderr.
> 
> Hmm, where in t5701?  Ah, you meant t5702 and possibly t5601.

Yes, sorry, I meant t5702.

> I actually think "it is long and not meant to be seen sequentially"
> is a bad classifier; these new messages are also progress report in
> that it reports "we are now in this phase".  So if I were to vote, I
> would say we should apply the same progress-silencing criteria,
> preferrably by not checking isatty() again, but by recording the
> decision we have already made when squelching the progress during
> the transfer in order to make sure they stay consistent.

Unfortunately that decision is made in the transport code, not by clone
itself. We can cheat and peek at "transport->progress" after
initializing the transport. That would require some refactoring, though;
we print "Cloning into" before setting up the transport. And we do not
even tell the transport about our progress options if we are doing a
local clone.

If we wanted to _just_ suppress "Checking connectivity" (and not
"Cloning into..."), that's a bit easier. And I could see an argument
that the former is the only one that falls into the "progress report"
category.

> > Also, we should arguably give the "Cloning into..." message the same
> > treatment. We have printed that to stdout for a very long time, so there
> > is a slim chance that somebody actually tries to parse it. But I think
> > they are wrong to do so; we already changed it once (in 28ba96a), and
> > these days it is internationalized, anyway.
> 
> Good thinking.  Please make it so ;-)

OK. I've squashed the "use stderr" patches into one, and added a patch
on top to correctly check the progress flag.

  [1/2]: clone: send diagnostic messages to stderr
  [2/2]: clone: treat "checking connectivity" like other progress

-Peff

  reply	other threads:[~2013-09-18 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 16:52 git clone silently aborts if stdout gets a broken pipe Peter Kjellerstedt
2013-09-18 18:45 ` Jeff King
2013-09-18 19:04   ` Jeff King
2013-09-18 19:31     ` Junio C Hamano
2013-09-18 20:01       ` Jeff King [this message]
2013-09-18 20:05         ` [PATCH 1/2] clone: send diagnostic messages to stderr Jeff King
2013-09-18 20:06         ` [PATCH 2/2] clone: treat "checking connectivity" like other progress Jeff King
2013-09-18 20:35           ` [PATCH 3/2] clone: always set transport options Jeff King
2013-09-19  7:54   ` git clone silently aborts if stdout gets a broken pipe Peter Kjellerstedt
2013-09-19  8:35     ` Jeff King
2013-09-19 15:48       ` Peter Kjellerstedt

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=20130918200152.GA17074@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=peter.kjellerstedt@axis.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).