-
-
Notifications
You must be signed in to change notification settings - Fork 7k
tool_progress: fix large time outputs and decimal size display #20177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Time output: - was broken for really large times - now uses spaces instead of --:--:-- - >99999y is now the largest shown time - show HH:MM:SS as long as hours are fewer than 100 Size: - made the decimal output always only use a single decimal Test: - Add test 1622 to verify these functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request fixes issues with large time output displays and improves decimal size formatting in the curl progress meter. The changes ensure that extremely large time values are properly handled and displayed, while size values now consistently use a single decimal place.
Key changes:
- Modified
time2str()to handle very large time values (up to >99999 years) with appropriate formatting transitions - Changed empty/zero time display from
--:--:--to spaces - Updated
max5data()to consistently show only one decimal digit for size values - Added comprehensive test coverage through test1622
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tool_progress.c | Updated time2str() to support days, months, and years formatting for large values; modified max5data() decimal calculation for consistent single-digit precision |
| src/tool_progress.h | Added UNITTEST declarations for max5data() and time2str() functions, and forward declaration for struct per_transfer |
| tests/tunit/tool1622.c | New unit test file that validates time2str() and max5data() functions with various input values |
| tests/tunit/Makefile.inc | Added tool1622.c to the test build |
| tests/data/test1622 | Test data file with expected outputs for time and size formatting tests |
| tests/data/Makefile.am | Added test1622 to the test data files list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
augment review |
🤖 Augment PR SummarySummary: This PR improves the curl tool progress meter’s formatting for both time durations and transferred-size values, especially at extreme ranges. Changes:
Technical Notes: Time formatting stays as 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review completed. No suggestions at this time.
Comment augment review to trigger a new review at any time.
Time output:
was broken for really large times
now uses spaces instead of --:--:--
>99999yis now the largest shown timeshow HH:MM:SS as long as hours are fewer than 100
Size:
Test: