git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>,
	Thomas Adam <thomas@xteddy.org>,
	Lars Schneider <larsxschneider@gmail.com>
Cc: Lars Schneider <lars.schneider@autodesk.com>,
	Git List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Stefan Beller <sbeller@google.com>,
	sunshine@sunshineco.com, sandals@crustytoothpaste.net,
	peff@peff.net
Subject: Re: [PATCH v4 0/2] launch_editor(): indicate that Git waits for user input
Date: Fri, 01 Dec 2017 09:11:56 +0530	[thread overview]
Message-ID: <1512099716.7882.2.camel@gmail.com> (raw)
In-Reply-To: <87a7z3re9a.fsf@linux-m68k.org>

On Thu, 2017-11-30 at 16:13 +0100, Andreas Schwab wrote:
> On Nov 30 2017, Thomas Adam <thomas@xteddy.org> wrote:
> 
> > On Thu, Nov 30, 2017 at 02:55:35PM +0100, Lars Schneider wrote:
> > > 
> > > > On 29 Nov 2017, at 19:35, Thomas Adam <thomas@xteddy.org> wrote:
> > > > 
> > > > On Wed, Nov 29, 2017 at 03:37:50PM +0100, lars.schneider@autodesk.com wrote:
> > > > > +		if (print_waiting_for_editor) {
> > > > > +			fprintf(stderr, _("hint: Waiting for your editor input..."));
> > > > > 			fflush(stderr);
> > > > 
> > > > Just FYI, stderr is typically unbuffered on most systems I've used, and
> > > > although the call to fflush() is harmless, I suspect it's not having any
> > > > effect.  That said, there's plenty of other places in Git which seems to think
> > > > fflush()ing stderr actually does something.
> > > 
> > > I agree with the "unbuffered" statement. I am surprised that you expect fflush()
> > > to do nothing in that situation... but I am no expert in that area. Can you
> > > point me to some documentation?
> > 
> > Because stderr is unbuffered, it will get printed immediately.
> 
> POSIX only requires stderr to be "not fully buffered".  If it is line
> buffered, the message may not appear immediately.
> 

I guess Junio's reply for the same "unbuffered" question I asked for an
earlier version of this patch (now, a series) might be relevant here,

> > Being curious again, is flushing 'stderr' required ? AFAIK, 'stderr'
> > is unbuffered by default and I didn't notice any calls that changed
> > the buffering mode of it along this code path.
> 
> "By default" is the key phrase.  The code is merely being defensive
> to changes in other area of the code.

cf. <xmqq8tf3oz3n.fsf@gitster.mtv.corp.google.com>


-- 
Kaartic

  reply	other threads:[~2017-12-01  3:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 14:37 [PATCH v4 0/2] launch_editor(): indicate that Git waits for user input lars.schneider
2017-11-29 14:37 ` [PATCH v4 1/2] refactor "dumb" terminal determination lars.schneider
2017-11-30 20:30   ` Jeff King
2017-12-01  3:26   ` Kaartic Sivaraam
2017-11-29 14:37 ` [PATCH v4 2/2] launch_editor(): indicate that Git waits for user input lars.schneider
2017-11-30 20:51   ` Jeff King
2017-12-01  3:56     ` Kaartic Sivaraam
2017-12-01 12:52     ` Lars Schneider
2017-12-01 18:29       ` Jeff King
2017-12-02  3:45         ` Kaartic Sivaraam
2017-12-03 16:39           ` Lars Schneider
2017-12-04 16:41             ` Kaartic Sivaraam
2017-12-04 17:26             ` Jeff King
2017-12-04 21:31               ` Lars Schneider
2017-12-04 21:42                 ` Jeff King
2017-12-04 21:54                   ` Lars Schneider
2017-12-04 22:09                     ` Jeff King
2017-12-04 17:25           ` Jeff King
2017-12-03  5:15     ` Junio C Hamano
2017-12-03 12:47       ` Lars Schneider
2017-12-04 17:32         ` Jeff King
2017-12-04 21:34           ` Lars Schneider
2017-12-04 21:40           ` Junio C Hamano
2017-12-04 17:30       ` Jeff King
2017-11-29 18:35 ` [PATCH v4 0/2] " Thomas Adam
2017-11-30 13:55   ` Lars Schneider
2017-11-30 14:42     ` Thomas Adam
2017-11-30 15:13       ` Andreas Schwab
2017-12-01  3:41         ` Kaartic Sivaraam [this message]
2017-11-30 20:12   ` Jeff King
2017-11-30 20:51     ` Thomas Adam

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=1512099716.7882.2.camel@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lars.schneider@autodesk.com \
    --cc=larsxschneider@gmail.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    --cc=sbeller@google.com \
    --cc=schwab@linux-m68k.org \
    --cc=sunshine@sunshineco.com \
    --cc=thomas@xteddy.org \
    /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).