Skip to content

Remove --global flag from switch command#22

Merged
rinse merged 3 commits intomainfrom
feature/remove-global-flag
Jun 9, 2025
Merged

Remove --global flag from switch command#22
rinse merged 3 commits intomainfrom
feature/remove-global-flag

Conversation

@rinse
Copy link
Copy Markdown
Owner

@rinse rinse commented Jun 9, 2025

Summary

• Remove --global flag from switch command to focus on local repository configuration
• Simplify CLI interface by removing an edge case that most users don't need
• Prevent accidental global configuration changes that would affect all repositories

Motivation

As discussed in #20, the --global flag goes against the core purpose of git-profile, which is to manage different Git configurations per project/repository. Global profile switching would affect all repositories system-wide, which is typically not the desired behavior.

Changes

  • Remove global flag from Switch command in CLI definition
  • Update switch functions to only work with local repository config
  • Remove all global-related logic and conditional messages
  • Remove test_switch_global_flag test case
  • Update documentation to reflect local-only operation

Test plan

  • All existing tests pass (minus the removed global flag test)
  • Manual testing confirms switch command works for local repos only
  • Attempting to use --global flag now shows appropriate error
  • Code review
  • No regression in local profile switching functionality

Fixes #20

🤖 Generated with Claude Code

rinse and others added 3 commits June 10, 2025 01:18
- Remove global flag from Switch command in CLI definition
- Update switch functions to only work with local repository config
- Remove all global-related logic and conditional messages
- Update tests to remove global flag test case
- Update documentation to reflect local-only operation

The switch command now only modifies local repository configuration,
which aligns with the typical use case of having different profiles
for different projects.
- Remove unused open_global() method from GitConfigGit2
- Update list command to only use local configuration
- Simplify codebase by removing global config access entirely

This change complements the removal of the --global flag by ensuring
all operations work exclusively with local repository configuration.
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rinse rinse merged commit 70512ef into main Jun 9, 2025
1 check passed
@rinse rinse deleted the feature/remove-global-flag branch June 9, 2025 16:36
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.

Remove --global flag from switch command

1 participant