git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luke Mewburn <luke@mewburn.net>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: Luke Mewburn <luke@mewburn.net>, git@vger.kernel.org
Subject: Re: [PATCH] reduce progress updates in background
Date: Tue, 14 Apr 2015 21:08:14 +1000	[thread overview]
Message-ID: <20150414110814.GF23475@mewburn.net> (raw)
In-Reply-To: <alpine.LFD.2.11.1504131052090.5619@knanqh.ubzr>

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

On Mon, Apr 13, 2015 at 11:01:04AM -0400, Nicolas Pitre wrote:
  | > That's what happens; the suppression only occurs if the process is
  | > currently background.  If I start a long-running operation (such as "git
  | > fsck"), the progress is displayed. I then suspend & background, and the
  | > progress is suppressed.  If I resume the process in the foreground, the
  | > progress starts to display again at the appropriate point.
  | 
  | I agree. I was just comenting on your suggestion about caching the 
  | in_progress_fd() result which would prevent that.

Ahh.  My suggestion about is_foreground_fd() result caching within
struct progress was only about caching the getpgid(0) portion of the
test (as that's not expected to change for the life of the process), and
not the tcgetpgrp(fd) portion.  I.e, add 'int curpgid' to struct
progress, set that to getpgid(0) in start_progress_display(), and
compare tcgetpgrp(fd) against progress->curpgid.

In any case, I think it's a micro optimisation not worth worrying about
at this point, given is_foreground_fd() is only called each time the
output would change, per your feedback.

regards,
Luke.

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2015-04-14 11:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 13:48 [PATCH] reduce progress updates in background Luke Mewburn
2015-04-13 14:11 ` Nicolas Pitre
2015-04-13 14:40   ` Luke Mewburn
2015-04-13 15:01     ` Nicolas Pitre
2015-04-14 11:03       ` [PATCH v2] " Luke Mewburn
2015-04-14 15:16         ` Nicolas Pitre
2015-04-15 18:29         ` [PATCH] compat/mingw: stubs for getpgid() and tcgetpgrp() Johannes Sixt
2015-04-15 18:48           ` Junio C Hamano
2015-04-15 20:34             ` Johannes Sixt
2015-04-16 12:48             ` Johannes Schindelin
2015-04-16 15:00               ` Junio C Hamano
2015-04-15 19:43           ` Erik Faye-Lund
2015-04-16 12:44             ` [msysGit] " Johannes Schindelin
2015-04-23 19:25               ` rupert thurner
2015-04-24  3:03                 ` rupert thurner
2015-04-24  6:25                 ` [msysGit] " Johannes Schindelin
2015-04-17  1:25           ` Luke Mewburn
2015-04-14 11:08       ` Luke Mewburn [this message]
2015-04-14  3:12 ` [PATCH] reduce progress updates in background brian m. carlson
2015-04-14  8:47   ` Johannes Schindelin

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=20150414110814.GF23475@mewburn.net \
    --to=luke@mewburn.net \
    --cc=git@vger.kernel.org \
    --cc=nico@fluxnic.net \
    /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).