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 09:52:50 -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 Sun Aug 30 18:52:58 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 1ZW5qj-00088v-Nh for gcvg-git-2@plane.gmane.org; Sun, 30 Aug 2015 18:52:58 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753586AbbH3Qwx (ORCPT ); Sun, 30 Aug 2015 12:52:53 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36213 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753556AbbH3Qww (ORCPT ); Sun, 30 Aug 2015 12:52:52 -0400 Received: by pabpg12 with SMTP id pg12so6719187pab.3 for ; Sun, 30 Aug 2015 09:52:52 -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=M4uR1jy5bAVwDT6csXibliH53FX2OMNXBaws0U0rXP8=; b=mYJqM0Y3SC3tlmWKq1/g/lk/yY/PZW6zGzJEHVKGGWEeBZ4wEGZctRYKdOVfTauViZ NCjFqp2rSqPWRZgZvEy83ztlwQZhNxeNXo5D+dYPcro6awp/pm7bv/ChBT6LSt3xBp+0 JIZ/mGemh00D1v9vIWx7mD3Yk41yED0B0SEdc5jsEcmNtonmJvbYyu0acJ7zWKFhvYzs gMQWt7L5v0o3XujM2l/S6r30Oz09/WKda4nyZI0DOUGS3mHqBGL+5gfG1RSbSpqBtVUY xypJUrfUsMH7qFngp6U9nUROZzfnyMdIiSRKL9UIjIQJGHuAuo+shubjkZur6ajCY+Ly fKIQ== X-Received: by 10.68.113.37 with SMTP id iv5mr31370118pbb.104.1440953572211; Sun, 30 Aug 2015 09:52:52 -0700 (PDT) Received: from localhost ([2620:0:1000:861b:7887:edde:b54f:7986]) by smtp.gmail.com with ESMTPSA id qu8sm11870664pab.29.2015.08.30.09.52.51 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 30 Aug 2015 09:52:51 -0700 (PDT) In-Reply-To: (Eric Sunshine's message of "Sun, 30 Aug 2015 04:14:35 -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: >>> Most portable likely would be Perl, however, that's probably too >>> heavyweight inside a loop like this, even if called only once each N >>> iterations. I think that is true. Now, when it is too heavy to spawn perl, would it be light enough to spawn awk, I have to wonder. Even if the implementation uses awk, I think the time measurement should be done only once each N iterations (e.g. every 1000 commits measure the rate and divide the remaining commits with that rate while displaying the progress; if you are chewing 100 commits per minute and have 2000 commits to go, you know it will take 20 more minutes). >> http://stackoverflow.com/questions/2445198/get-seconds-since-epoch-in-any-posix-compliant-shell >> Found this, >> >> awk 'BEGIN{srand();print srand()}' >> >> srand() in awk returns the previous seed value, and calling it without >> an argument sets it to time of day, so the above sequence should >> return seconds since the epoch, or at least something in seconds that >> is relative to a fixed point which is all that's needed in this >> thread. In practice this should work, but it makes me feel somewhat uneasy. POSIX says "Set the seed value for rand to expr or use the time of day if expr is omitted. The previous seed value shall be returned." but I do not see anything that says that "the time of day" is counted in seconds around there (which is the crucial bit for this application). http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html (4.15 Seconds since the Epoch) says "The relationship between the actual time of day and the current value for seconds since the Epoch is unspecified."