git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [FEATURE REQUEST] Filter-branch extend progress with a simple estimated time remaning

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 30, 2015, 19:55 UTC
Message-ID
<CAPig+cTYc8isW0zhtZOLAtP+Kk_j8-yGKt4uHu0THT2QG8wTXA@mail.gmail.com>
In-Reply-To
<CANy2qHf-HcJVyqo83y0+CtVnNp9TzHC479Lzu+NbpCF9k=8g1A@mail.gmail.com>
(please don't top-post on this list)
On Sun, Aug 30, 2015 at 12:58 PM, Gabor Bernat <bernat@primeranks.net> wrote:
> I would argue against the every n commit check, or at least making it
> configurable, as in my case the speed is something between 0.01 and
> 1.5 seconds per commit. Checking it every n commit would make it I
> feel quite slow to adapt. But it's debatable.

I'm wondering why these two decisions ("showing estimated time" and "frequency of the computation") should be put in the hands of the user in the first place.

1. Why have a --progress-eta option at all as opposed to just enabling
it unconditionally if the platform can support it ("date +%s") and if
it can be done without impacting the overall runtime noticeably?
2. Why make the user responsible for deciding how often to do the time
check (via some configuration) as opposed to adjusting it dynamically
based upon how quickly the operation is proceeding. That is, if the
filter-branch operation is zipping along at 0.01 seconds per commit,
then the time check can be done less frequently (say every 50 or 100
commits) so that it doesn't slow the overall operation. Conversely, if
the operation is molasses, moving at 2 seconds per commit, then doing
the time check more frequently (perhaps after each commit) probably
won't noticeably impact the user's perception of the operation's
progress.
Show 38 quoted lines
> On 8/30/15, Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Sunshine <sunshine@sunshineco.com> 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."
Previous: Mikael MagnussonNext: Eric Sunshine
Message 21 of 24 in “[FEATURE REQUEST] Filter-branch extend progress with a simple estimated time remaning”
  1. Gabor BernatAug 25, 2015
  2. Jeff KingAug 25, 2015
  3. Junio C HamanoAug 25, 2015
  4. Jeff KingAug 25, 2015
  5. Jeff KingAug 25, 2015
  6. Gabor BernatAug 25, 2015
  7. Eric SunshineAug 25, 2015
  8. Jeff KingAug 26, 2015
  9. Gabor BernatAug 29, 2015
  10. Gabor BernatAug 29, 2015
  11. Eric SunshineAug 30, 2015
  12. Gabor BernatAug 30, 2015
  13. Eric SunshineAug 30, 2015
  14. Mikael MagnussonAug 30, 2015
  15. Gabor BernatAug 30, 2015
  16. Mikael MagnussonAug 30, 2015
  17. Eric SunshineAug 30, 2015
  18. Junio C HamanoAug 30, 2015
  19. Gabor BernatAug 30, 2015
  20. Mikael MagnussonAug 30, 2015
  21. Eric SunshineAug 30, 2015
  22. Eric SunshineAug 30, 2015
  23. Eric SunshineAug 30, 2015
  24. Junio C HamanoAug 31, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.