First off, thank you for considering contributing to Git Workers! It's people like you that make Git Workers such a great tool.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Coding Standards
- Testing
- Pull Request Process
- Reporting Issues
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository on GitHub
- Clone your fork locally
- Create a new branch for your feature or bug fix
- Make your changes
- Push to your fork and submit a pull request
- Rust 1.70+
- Git 2.20+
- macOS or Linux (Windows not supported)
# Clone your fork
git clone https://github.com/yourusername/git-workers.git
cd git-workers
# Build the project
cargo build
# Run tests
cargo test
# Run the application
cargo run# Development build
cargo build
# Release build
cargo build --release
# Install locally
cargo install --path .
# Run with logging
RUST_LOG=debug cargo run-
rustfmt: For code formatting
rustup component add rustfmt
-
clippy: For linting
rustup component add clippy
git-workers/
├── src/
│ ├── main.rs # CLI entry point
│ ├── commands.rs # Command implementations
│ ├── git.rs # Git worktree operations
│ ├── menu.rs # Menu definitions
│ ├── config.rs # Configuration management
│ ├── hooks.rs # Hook system
│ ├── repository_info.rs # Repository information display
│ ├── input_esc_raw.rs # Custom input handling with ESC support
│ └── utils.rs # Utility functions
├── shell/
│ └── gw.sh # Shell integration script
├── tests/ # Integration tests
├── .github/
│ ├── workflows/ # CI/CD workflows
│ └── ISSUE_TEMPLATE/ # Issue templates
├── Cargo.toml # Project dependencies
├── lefthook.yml # Git hooks configuration
└── README.md # Project documentation
- Follow the Rust Style Guide
- Use
cargo fmtbefore committing - Run
cargo clippyand address any warnings - Write idiomatic Rust code
- Keep functions small and focused
- Use descriptive variable and function names
- Add comments for complex logic
- Group related functionality in modules
- Use
Result<T, E>for operations that can fail - Provide meaningful error messages
- Use
anyhowfor error handling in application code - Use specific error types in library code
- Unit Tests: Test individual functions and modules
- Located in
src/*.rsfiles within#[cfg(test)]modules
- Located in
- Integration Tests: Test the entire application flow
- Located in
tests/directory
- Located in
- Manual Tests: For interactive features
- Documented in
tests/manual_test_guide.md
- Documented in
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run tests with output
cargo test -- --nocapture
# Run tests in release mode
cargo test --release- Write tests for new features
- Update tests when modifying existing functionality
- Aim for high test coverage
- Test edge cases and error conditions
-
Before submitting:
- Ensure all tests pass
- Run
cargo fmtandcargo clippy - Update documentation if needed
- Add tests for new functionality
-
PR Guidelines:
- Use a clear and descriptive title
- Reference any related issues
- Provide a detailed description of changes
- Include screenshots for UI changes
-
PR Template:
## Description Brief description of changes ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Testing - [ ] Tests pass locally - [ ] Added new tests - [ ] Manual testing completed ## Checklist - [ ] Code follows style guidelines - [ ] Self-review completed - [ ] Documentation updated - [ ] No new warnings
When reporting bugs, please include:
- Git Workers version (
gw --version) - Operating system and version
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages (if any)
For feature requests, please include:
- Use case description
- Expected behavior
- Why this feature would be useful
- Any implementation suggestions
- Pick an issue: Look for issues labeled
good first issueorhelp wanted - Discuss: Comment on the issue before starting work
- Branch: Create a feature branch from
main - Develop: Make your changes following the coding standards
- Test: Ensure all tests pass
- Commit: Use clear, conventional commit messages
- Push: Push to your fork
- PR: Open a pull request
Follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test additions or changeschore: Maintenance tasks
Example:
feat(worktree): add fuzzy search functionality
Implement fuzzy search for worktree names and branches using
skim algorithm. This allows users to quickly find worktrees
by typing partial names.
Closes #123
Feel free to open an issue for any questions about contributing!