Re: [PATCH] reduce progress updates in background
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Apr 14, 2015, 03:12 UTC
- Message-ID
- <20150414031227.GB591600@vauxhall.crustytoothpaste.net>
- In-Reply-To
- <20150413134850.GC23475@mewburn.net>
On Mon, Apr 13, 2015 at 11:48:50PM +1000, Luke Mewburn wrote:
Show 11 quoted lines
> Hi, > > I've noticed that when a long-running git operation that generates > progress output is suspended and converted to a background process, > the terminal still gets spammed with progress updates (to stderr). > > I've explicitly separated the in_progress_fd() function > so that it's easier to (a) reuse elsewhere where appropriate, > and (b) make any portability changes to the test if necessary. > I also used getpgid(0) versus getpgrp() to avoid portability > issues with the signature in the latter with pre-POSIX.
I like this patch. It's simple and seems like a sensible change, and I appreciated the opportunity to learn about tcgetpgrp(3). The Windows folks will probably need to stub that function out, but they're no worse off than they were before.
I do agree with Nicolas that optimizing the code to avoid calling in_progress_fd as much as possible is a good idea, since system calls can be expensive on some systems.
-- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187