Add CLI command to list Git-style references#1302
Open
jordpo wants to merge 2 commits intoearth-mover:mainfrom
Open
Add CLI command to list Git-style references#1302jordpo wants to merge 2 commits intoearth-mover:mainfrom
jordpo wants to merge 2 commits intoearth-mover:mainfrom
Conversation
Implements a new `icechunk ref list` command that displays all branches and tags in an Icechunk repository, similar to `git show-ref`. This addresses the need for users to easily view all references in a repository from the command line without needing to use the Python API. Changes: - Add `ref` subcommand with `list` operation to CLI - Implement `ref_list()` handler that calls Repository::list_branches() and Repository::list_tags() - Format output as `branch: <name>` and `tag: <name>` for clarity - Add comprehensive test that creates repository with multiple branches and tags and verifies correct output Test coverage: - Added `test_ref_list()` that creates a repo with main branch, feature branch, and v1.0 tag, then verifies all refs appear in output - Test passes with `cargo test --lib --features cli` Fixes earth-mover#827 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a new
icechunk ref listcommand that displays all branches and tags in an Icechunk repository, providing Git-style reference listing functionality from the CLI.Fixes #827
Motivation
Users need a convenient way to view all references (branches and tags) in their Icechunk repositories from the command line, similar to
git show-reforgit branch -a. Currently, this requires using the Python API, which is less convenient for quick repository inspection.Approach
This PR adds a new
refsubcommand to the Icechunk CLI with alistoperation that:snapshot listandconfig listRepository::list_branches()andRepository::list_tags()methods that are already available in the Rust codebaseChanges
Ref(RefCommand)variant to the CLICommandenumRefCommandenum withList(RefListCommand)subcommandref_list()handler function that:run_cli()executorTest Coverage
Added
test_ref_list()integration test that:feature) and tag (v1.0)Test passes with:
cargo test --lib --features cli cli::interface::tests::test_ref_listUsage
Testing
Manually tested with:
All existing CLI tests continue to pass.
🤖 Generated with Claude Code