Skip to content
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

image/tree: Print longest names first and use full width #5757

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

vvoland
Copy link
Collaborator

@vvoland vvoland commented Jan 17, 2025

When printing image names, sort them by length and print the longest first. This also allows them to use a full terminal width because they are not printed alongside other columns.

Before
image

After
image

- Description for the changelog

Fix `docker images --tree` unnecessary truncating long image names when multiple names are available

- A picture of a cute animal (not mandatory but encouraged)

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 59.45%. Comparing base (f4a68da) to head (26010e4).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5757      +/-   ##
==========================================
- Coverage   59.47%   59.45%   -0.02%     
==========================================
  Files         346      346              
  Lines       29367    29376       +9     
==========================================
  Hits        17465    17465              
- Misses      10929    10938       +9     
  Partials      973      973              

@vvoland vvoland requested review from a team and laurazard January 17, 2025 14:47
Copy link
Collaborator

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cli/command/image/tree.go Outdated Show resolved Hide resolved
When printing image names, sort them by length and print the longest
first. This also allows them to use a full terminal width because they
are not printed alongside other columns.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Copy link
Contributor

@krissetto krissetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP IT

@vvoland vvoland merged commit 66a584a into docker:master Jan 20, 2025
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants