Skip to content

Truncate the names list on ps - #7686

Merged
crosbymichael merged 1 commit into
moby:masterfrom
guywithnose:trancateNames
Aug 27, 2014
Merged

crosbymichael merged 1 commit into
moby:masterfrom
guywithnose:trancateNames

Conversation

@guywithnose

Copy link
Copy Markdown
Contributor

This keeps the output readable even when a container has a lot of names. This can easily happen if you are developing with a testing image that links to another image. I see this happen all the time while using fig.

For example if you are running a test build that requires a mongo image:
After the first run you're names list on the mongo image is build_1/mongo,mongo
After the second run you're names list on the mongo image is build_2/mongo,build_1/mongo,mongo
After the 100th run running docker ps is very difficult to read.

This pull request simply truncates the names list by default the same way that the id and command are already truncated. If you need to see the whole list you just run docker ps --no-trunc.

@guywithnose

Copy link
Copy Markdown
Contributor Author

ping @vieux

@vieux

vieux commented Aug 27, 2014

Copy link
Copy Markdown
Contributor

LGTM

@crosbymichael

Copy link
Copy Markdown
Contributor

Do you think 40 chars it too long for the truncated version?

@guywithnose

Copy link
Copy Markdown
Contributor Author

40 chars was admitedly, quite arbitrary. My thought was that I would like to be able to see the first name completely and that may be in a format similar to build_2/some_app/mongo. It may be better to just print the full first name instead of a character limit.

Signed-off-by: Robert Bittle <[email protected]>
@guywithnose

Copy link
Copy Markdown
Contributor Author

I changed it to just print the full first name

@crosbymichael

Copy link
Copy Markdown
Contributor

Nice, I like that idea better

@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Aug 27, 2014
@crosbymichael
crosbymichael merged commit 835800f into moby:master Aug 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants