Skip to content

Show canonical name in docker ps - #8489

Closed
bjaglin wants to merge 2 commits into
moby:masterfrom
bjaglin:canonicalnameinps
Closed

bjaglin wants to merge 2 commits into
moby:masterfrom
bjaglin:canonicalnameinps

Conversation

@bjaglin

@bjaglin bjaglin commented Oct 9, 2014

Copy link
Copy Markdown

After trying out the upcoming 1.3.0, I was pleased to see that #7686 made the default output of docker ps more compact. However, keeping the very first name could be confusing, as it might be the name resulting from a --link (foo/bar). @guywithnose @crosbymichael was that on purpose?

This patches makes sure that the canonical name is shown (which also happens to be the shortest), and avoid unnecessary processing of the names.

@bjaglin

bjaglin commented Oct 9, 2014

Copy link
Copy Markdown
Author

added a documentation update commit which should have been merged together with #7686 IMHO

@guywithnose

Copy link
Copy Markdown
Contributor

It wasn't on purpose. It was just simpler and I'm very new to go. I like this much better.

Comment thread api/client/commands.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure that understand this code. Here outNames will be length 1? Is possible that there is no canonical name?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

AFAIK, there is always a canonical name, either implicit or explicit. And yes, when noTrunc == false, that code flattens outNames to a single-item slice.

@LK4D4

LK4D4 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

Also I think this deserves cli test and commit squashing - two commits with code and docs should be enough

@bjaglin

bjaglin commented Oct 9, 2014

Copy link
Copy Markdown
Author

@LK4D4 i'll add a CLI test. Regarding the commit policy, I was going more for semantic commits, but should it be one for code&test and one for docs? thanks!

@LK4D4

LK4D4 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

@bjaglin That will be nice. I just was confused by "only process names when necessary" commit and thought that you might want to squash it :)

@bjaglin

bjaglin commented Oct 9, 2014

Copy link
Copy Markdown
Author

OK - I was just trying to keep pure refactoring changes outside the actual change, but I am happy to squash them as well!

@bjaglin
bjaglin force-pushed the canonicalnameinps branch from 2f89f46 to 24e64b7 Compare October 9, 2014 20:24
@bjaglin

bjaglin commented Oct 9, 2014

Copy link
Copy Markdown
Author

CLI test added and commits squashed.

A question that comes to my mind, although more related to #7686 than this PR, is whether the NAMES column shouldn't be called NAME when --no-trunc is passed. Any opinion?

@LK4D4

LK4D4 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

I'm not sure what do you mean by commit "reflect changes introduced in d2ffcd9", maybe you forgot to mention "docs" in commit message.

@LK4D4

LK4D4 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

Code LGTM

Docker-DCO-1.1-Signed-off-by: Brice Jaglin <[email protected]> (github: bjaglin)
Docker-DCO-1.1-Signed-off-by: Brice Jaglin <[email protected]> (github: bjaglin)
@bjaglin

bjaglin commented Oct 10, 2014

Copy link
Copy Markdown
Author

I just added "in docs" in the first message.

@bjaglin bjaglin mentioned this pull request Oct 10, 2014

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what if lines length is for some reason < 2, this is going to panic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also thanks for using %q :)

@crosbymichael

Copy link
Copy Markdown
Contributor

I'll take this one, there is a simpler way to do what we want.

@crosbymichael crosbymichael self-assigned this Oct 10, 2014
@crosbymichael crosbymichael added this to the 1.3.0 milestone Oct 10, 2014
@bjaglin

bjaglin commented Oct 10, 2014

Copy link
Copy Markdown
Author

Replaced by #8505

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.

7 participants