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

Add flag to follow refs in info command #994

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Add flag to follow refs in info command #994

merged 1 commit into from
Mar 13, 2024

Conversation

rydrman
Copy link
Collaborator

@rydrman rydrman commented Mar 1, 2024

This is something that I regularly bump into, where I have a layer digest, but want to see the contents of the manifest. Rather than needing to copy and paste the digest into the info command again, this will follow each child reference down to the manifest and print them all.

@rydrman rydrman added the QoL quality of life fixes label Mar 1, 2024
@rydrman rydrman requested review from jrray and dcookspi March 1, 2024 18:02
@rydrman rydrman self-assigned this Mar 1, 2024
#[clap(long)]
follow: bool,

/// Remaining refs to process, used to handle recursive
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Recursive" got me thinking. Is it possible to craft a chain of objects with a cycle? You'll need a already_visited set to break cycles.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because of the way we hash, I don't think a cycle is possible

crates/spfs/src/storage/fs/hash_store.rs Outdated Show resolved Hide resolved
This is something that I regularly bump into, where I have a layer
digest, but want to see the contents of the manifest. Rather than
needing to copy and paste the digest into the info command again, this
will follow each child reference down to the manifest and print them
all.

Signed-off-by: Ryan Bottriell <ryan@bottriell.ca>
@rydrman rydrman merged commit e9db96b into main Mar 13, 2024
7 checks passed
@rydrman rydrman deleted the info-follow branch March 13, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QoL quality of life fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants