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

Re: [PATCH v4 0/2] launch_editor(): indicate that Git waits for user input

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Dec 1, 2017, 03:41 UTC
Message-ID
<1512099716.7882.2.camel@gmail.com>
In-Reply-To
<87a7z3re9a.fsf@linux-m68k.org>
On Thu, 2017-11-30 at 16:13 +0100, Andreas Schwab wrote:
Show 25 quoted lines
> 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,

Show 6 quoted lines
> > 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
Previous: Andreas SchwabNext: Jeff King
Message 29 of 31 in “launch_editor(): indicate that Git waits for user input”
  1. 0/2 launch_editor(): indicate that Git waits for user inputlars.schneider@autodesk.com, Nov 29, 2017
  2. 1/2 refactor "dumb" terminal determinationlars.schneider@autodesk.com, Nov 29, 2017
  3. Jeff KingNov 30, 2017
  4. Kaartic SivaraamDec 1, 2017
  5. 2/2 launch_editor(): indicate that Git waits for user inputlars.schneider@autodesk.com, Nov 29, 2017
  6. Jeff KingNov 30, 2017
  7. Kaartic SivaraamDec 1, 2017
  8. Lars SchneiderDec 1, 2017
  9. Jeff KingDec 1, 2017
  10. Kaartic SivaraamDec 2, 2017
  11. Lars SchneiderDec 3, 2017
  12. Kaartic SivaraamDec 4, 2017
  13. Jeff KingDec 4, 2017
  14. Lars SchneiderDec 4, 2017
  15. Jeff KingDec 4, 2017
  16. Lars SchneiderDec 4, 2017
  17. Jeff KingDec 4, 2017
  18. Jeff KingDec 4, 2017
  19. Junio C HamanoDec 3, 2017
  20. Lars SchneiderDec 3, 2017
  21. Jeff KingDec 4, 2017
  22. Lars SchneiderDec 4, 2017
  23. Junio C HamanoDec 4, 2017
  24. Jeff KingDec 4, 2017
  25. Thomas AdamNov 29, 2017
  26. Lars SchneiderNov 30, 2017
  27. Thomas AdamNov 30, 2017
  28. Andreas SchwabNov 30, 2017
  29. Kaartic SivaraamDec 1, 2017
  30. Jeff KingNov 30, 2017
  31. Thomas AdamNov 30, 2017

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.