Remove Co-author Functionality - #2
Merged
michaldarda merged 4 commits intoSep 11, 2025
Merged
Conversation
- Add remove_coauthor() function that removes specific co-authors - Support removal by name, email, or global roster alias - Implement case-insensitive name matching - Add matches_coauthor() helper for flexible identifier matching - Automatically update git hook when co-authors are removed - Remove git hook entirely when last co-author is removed - Add comprehensive unit tests for all removal scenarios
- Add 'remove' command to CLI with proper argument parsing - Support usage: git-pair remove <name|email|alias> - Update help text with remove command documentation - Add usage examples for all removal methods - Include helpful error messages and usage hints
- Add 5 new integration tests covering remove operations: * Remove by name (Test 15) * Remove by email (Test 16) * Remove by global alias (Test 17) * Error handling for non-existent co-authors (Test 18) * Hook removal when last co-author removed (Test 19) - Update test count from 14 to 19 tests - Verify end-to-end functionality with real git operations
- Add remove command to features list with granular management - Document remove command usage with examples for name, email, and alias - Add remove command to commands reference table - Include practical examples for mob programming and dynamic teams - Show flexible co-author management during development sessions
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.
Remove Co-author Functionality
This document describes the new co-author removal functionality added to git-pair, which allows for granular management of co-authors during pair programming sessions.
Overview
The
git pair removecommand enables selective removal of co-authors from the current branch, providing more flexibility than the existinggit pair clearcommand which removes all co-authors at once. This feature is particularly useful during:Features
Multiple Removal Methods
The remove command supports three different ways to identify and remove co-authors:
Case-Insensitive Matching
Name-based removal is case-insensitive, making it more user-friendly:
git pair remove "john doe"matchesJohn Doegit pair remove "ALICE JOHNSON"matchesAlice JohnsonSmart Hook Management
The git hook is automatically managed when co-authors are removed:
Usage
Basic Syntax
Where
<identifier>can be:Examples
Remove by Name
Remove by Email
# Remove co-author by email address git pair remove alice.johnson@company.com git pair remove bob@example.orgRemove by Global Alias
Workflow Examples
Dynamic Mob Programming
Specialist Contributions
Error Recovery
Error Handling
The remove command provides clear error messages for various scenarios:
Co-author Not Found
Global Alias Not Found
Not Initialized
Usage Help
Technical Implementation
Matching Logic
The remove functionality uses a hierarchical matching approach:
Hook Management
The git hook is intelligently managed during removal operations:
File Operations
Co-author removal modifies the branch-specific configuration file (
.git/git-pair/config-{branch_name}):Integration with Existing Features
Compatibility with Global Roster
The remove command seamlessly integrates with the global roster feature:
Per-Branch Isolation
Removal is branch-specific and doesn't affect other branches:
Status Integration
The
git pair statuscommand shows the current state after removals:Best Practices
1. Use Meaningful Identifiers
Choose the most convenient identifier based on context:
2. Verify Before Committing
Always check status after making changes:
3. Communicate Changes
When working in teams, communicate co-author changes:
4. Use Clear Commit Messages
Document team changes in your commit messages:
git commit -m "Implement authentication (Alice left session early)"Comparison with Clear Command
git pair removegit pair clearTesting
The remove functionality includes comprehensive testing:
Unit Tests (7 tests)
Integration Tests (5 tests)
Migration and Compatibility
Backward Compatibility
The remove functionality is fully backward compatible:
No Migration Required
Existing git-pair installations can immediately use the remove functionality without any configuration changes or data migration.
Future Enhancements
Potential future improvements to the remove functionality:
Multiple Removal
# Remove multiple co-authors in one command git pair remove alice bob carolPattern Matching
Interactive Removal
# Interactive mode for selecting co-authors to remove git pair remove --interactiveConfirmation Prompts
# Add confirmation for destructive operations git pair remove alice --confirmConclusion
The remove co-author functionality significantly enhances git-pair's flexibility for dynamic team collaboration. By providing granular control over co-author management while maintaining the tool's simplicity and reliability, it enables more sophisticated pair and mob programming workflows without sacrificing ease of use.
The feature seamlessly integrates with existing git-pair functionality, maintains backward compatibility, and follows the established patterns for error handling and user experience. With comprehensive testing and intelligent hook management, it provides a robust foundation for flexible team collaboration in Git repositories.