From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [FEATURE REQUEST] Filter-branch extend progress with a simple estimated time remaning Date: Sun, 30 Aug 2015 22:06:26 -0700 Message-ID: References: <20150825171238.GB9674@sigill.intra.peff.net> <20150825185210.GA10032@sigill.intra.peff.net> <20150825185414.GA10895@sigill.intra.peff.net> <20150826021517.GA20292@sigill.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain Cc: Mikael Magnusson , Gabor Bernat , Jeff King , Git List To: Eric Sunshine X-From: git-owner@vger.kernel.org Mon Aug 31 07:09:16 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZWHLH-0001H6-6t for gcvg-git-2@plane.gmane.org; Mon, 31 Aug 2015 07:09:15 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbbHaFGb (ORCPT ); Mon, 31 Aug 2015 01:06:31 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35398 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbbHaFG2 (ORCPT ); Mon, 31 Aug 2015 01:06:28 -0400 Received: by pacdd16 with SMTP id dd16so126339268pac.2 for ; Sun, 30 Aug 2015 22:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=4yjxwuT1t7e7aXY1XDHVJvPz05ca7NxiY5cOAZ9YwsQ=; b=KqrW4V8w7pI12K2GMH6suXENCtsJF1KVObLzR9mpYiu+jbXoJgMtN9Ybno/UjB3rWe M9RkDcfd0I3Fse6d+ThgW3zeLEKapBqMT8fF7l4f4fXFd+W8vDNR7aCTrFevANFhWmd3 1NZhKk0tKMYY3HCtbIAoEl7dBqZHFV9DDv7nFoJK1xtmZ/ifuVJ5nTietSQzdO2NLCzU etVsRM3f9JWIfvmI0nsJ+9jDtHIzbbtpa+O5TlBNavMYTy9Iy+xMU6oN5fPHcQX7CFrM XeM0W4rRY7JMYPgSyWVgC6iJ8bGxAKtDbe/ZEDYCqh0psa3is+TiNsYcS2WitKYGeEDr Rieg== X-Received: by 10.66.248.72 with SMTP id yk8mr34240800pac.112.1440997588286; Sun, 30 Aug 2015 22:06:28 -0700 (PDT) Received: from localhost ([2620:0:1000:861b:1937:16f4:ede1:6d38]) by smtp.gmail.com with ESMTPSA id bc10sm12907278pbd.14.2015.08.30.22.06.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 30 Aug 2015 22:06:27 -0700 (PDT) In-Reply-To: (Eric Sunshine's message of "Sun, 30 Aug 2015 15:40:20 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Eric Sunshine writes: > 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.