Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for removing Git DRS remotes via the git drs remote remove command (with rm alias). The implementation handles both modern namespaced and legacy configuration keys, automatically reassigns the default remote when needed, and includes thorough test coverage.
Changes:
- Added
git drs remote remove <name>command withrmalias for removing configured DRS remotes - Implemented safe default-remote handling that automatically reassigns to another remote alphabetically or clears when last remote is removed
- Added comprehensive unit tests covering removal scenarios, default reassignment, and legacy config cleanup
- Updated documentation with command reference and practical use-case guide
Reviewed changes
Copilot reviewed 8 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/remote/remove.go | New command implementation with argument validation and remote-not-found error handling |
| cmd/remote/root.go | Registers RemoveCmd under the remote subcommand |
| config/config.go | Implements RemoveRemote function with namespaced/legacy cleanup and default reassignment logic |
| cmd/remote/remote_test.go | Command-level tests for args validation, aliases, and execution scenarios |
| config/config_test.go | Config-level tests for default reassignment, last remote removal, and legacy cleanup |
| docs/commands.md | Command reference documentation with usage examples |
| docs/remote-remove-use-cases.md | Practical use-case guide with scenario-based examples |
| README.md | Updated command list and documentation links |
| coverage/*.out | Updated coverage files showing good test coverage for new code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
lbeckman314
approved these changes
Feb 13, 2026
Contributor
There was a problem hiding this comment.
Test Steps 🌀
1. Install
➜ git checkout feature/cmd-remote-remove
➜ git show --summary --oneline
22c6ff4 (HEAD -> feature/cmd-remote-remove, origin/feature/cmd-remote-remove) Update docs/remote-remove-use-cases.md
➜ make install
➜ which git-drs
$HOME/go/bin/git-drs
➜ git-drs version
git-drs v0.5.16-0.20260213164041-22c6ff45e179+dirty-22c6ff42. Initialize Repo
➜ cd /tmp
➜ mkdir testing
➜ cd testing
➜ git init
➜ git drs init3. Add Remote
➜ git drs remote add gen3 example --bucket example --project example --cred ~/.gen3/credentials.json.calypr-dev
➜ git drs remote list
* example gen3 https://calypr-dev.ohsu.edu4. Remove Remote
➜ git drs remote rm example
➜ git drs remote list
<EMPTY>
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
This PR adds and refines support for removing Git DRS remotes, including:
git drs remote remove <name>with rm alias (git drs remote rm <name>).Cleanup of both namespaced and legacy remote config keys.
Safe default-remote handling (reassign when possible, clear when last remote is removed).
Expanded tests for remove behavior and edge cases.
Documentation updates and a conversation-derived use-case guide clarifying why git remote remove does not remove Git DRS remotes.
Why
Confusing user experience. Due to missing
git drs remote remove. This PR provides first-class UX for DRS remote removal and clearer guidance in docs.Implementation Details
Added remove command usage/alias and error messaging at the CLI layer.
Registered command under git drs remote.
Implemented config cleanup for namespaced + legacy remote entries and default reassignment/clearing logic.
Test Coverage
Command tests include args validation, alias presence, successful removal, and not-found behavior.
Config tests include removing default, removing last remote (default clears), and legacy remote cleanup behavior.
Documentation
Commands reference now includes remove and rm usage/examples.
Added dedicated use-case doc with conversation-derived scenario (git remote remove vs git drs remote rm).
README now links the use-case doc and lists remote remove in command overview.
Reviewer Notes (please check docs)
Please specifically review the documentation updates for:
Accuracy of the user-facing command guidance in docs/commands.md.
Clarity of the migration/use-case narrative in docs/remote-remove-use-cases.md.
Consistency with README command and docs links.