Re: [FEATURE REQUEST] Filter-branch extend progress with a simple estimated time remaning
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 31, 2015, 05:06 UTC
- Message-ID
- <xmqq4mjgyrl9.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAPig+cTf2YLWGi2swmMxdx_XpEU=GkAx11ng6VVACMX9NpA_SQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 11 quoted lines
> I suppose a viable approach might be to test once outside the loop if > "date +%s" is supported and print the "(%d elapsed / %d estimated > remaining)" annotation within the loop if it is, else not. The test > might look something like this: > > echo $(date +%s) | grep -q '^[0-9][0-9]*$' 2>/dev/null && show_eta=t > > Platforms, such as Linux, Mac OS X, and FreeBSD, which support "date > +%s" would get the annotated output, whereas it would fall back > gracefully to the non-annotated output on platforms such as Solaris > (and perhaps AIX) which lack it.
I kind of like this for its simplicity, especially given that it would cover the vast majority of users in practice.