This document tracks the implementation of ddworktree based on the design specification.
- ✅ Completed
- 🔄 In Progress
- ⏳ Pending
- ❌ Failed
-
1.1 Create project structure
- Create
ddworktree/main package directory - Create
ddworktree/commands/for command modules - Create
ddworktree/utils/for utility modules - Create
ddworktree/core.pyfor core functionality - Create
ddworktree/cli.pyfor CLI interface - Create
ddworktree/__main__.pyfor module execution - Create
tests/directory - Create
setup.pyorpyproject.toml - Create
.gitignore - Create
README.md
- Create
-
1.2 Set up core configuration system
- Implement
.ddconfigfile handling (TOML/YAML) - Create configuration parser and validator
- Implement default configuration values
- Create configuration file management utilities
- Implement
-
1.3 Implement core GitPython integration
- Create Git repository wrapper class
- Implement worktree detection and management
- Create gitignore parsing utilities
- Implement commit tracking and linking
- 2.1.1 Create
worktree_add.pycommand module - 2.1.2 Implement paired worktree creation
- Validate path and commit-ish parameters
- Handle
--no-localflag - Handle
--track <branch>flag - Create main worktree
- Create local worktree with
.gitignore-local - Update
.ddconfigwith new pair - Test collision detection
- 2.1.3 Write tests for
worktree add
- 2.2.1 Create
worktree_list.pycommand module - 2.2.2 Implement worktree listing functionality
- Call
git worktree list - Cross-reference with
.ddconfig - Compute drift/sync status
- Display formatted table with indicators
- 2.2.3 Write tests for
worktree list
- Call
- 2.3.1 Create
worktree_remove.pycommand module - 2.3.2 Implement worktree removal
- Validate path/alias parameter
- Handle
--keep-localflag - Remove both worktrees or just one
- Update
.ddconfig - Provide confirmation and cleanup
- 2.3.3 Write tests for
worktree remove
- 3.1.1 Create
add.pycommand module - 3.1.2 Implement file staging with ignore rules
- Parse both
.gitignoreand.gitignore-local - Auto-detect appropriate worktree
- Stage files respecting ignore scopes
- 3.1.3 Write tests for
add
- Parse both
- 3.2.1 Create
commit.pycommand module - 3.2.2 Implement paired commits
- Handle
-m <message>parameter - Handle
--amendflag - Handle
--splitflag - Detect shared vs local-only changes
- Link commits via metadata or suffix
- 3.2.3 Write tests for
commit
- Handle
- 3.3.1 Create
reset.pycommand module - 3.3.2 Implement paired reset functionality
- Handle optional
<commit-ish>parameter - Handle
--hard,--soft,--keep-localflags - Reset both trees safely
- Preserve ignored/local-only files
- Warn before hard reset
- 3.3.3 Write tests for
reset
- Handle optional
- 3.4.1 Create
rm.pycommand module - 3.4.2 Implement file removal across trees
- Remove tracked files respecting ignore rules
- Skip ignored or local-only files appropriately
- 3.4.3 Write tests for
rm
- 3.5.1 Create
mv.pycommand module - 3.5.2 Implement file renaming across trees
- Validate source and destination paths
- Apply
git mvin both applicable trees - 3.5.3 Write tests for
mv
- 4.1.1 Create
fetch.pycommand module - 4.1.2 Implement fetch functionality
- Handle
--alland--pruneflags - Fetch remote updates for paired branches
- Verify branch state in both trees
- 4.1.3 Write tests for
fetch
- Handle
- 4.2.1 Create
pull.pycommand module - 4.2.2 Implement pull functionality
- Handle optional
<remote>and<branch>parameters - Run
git pullin both trees - Handle merge conflicts for local files
- 4.2.3 Write tests for
pull
- Handle optional
- 4.3.1 Create
push.pycommand module - 4.3.2 Implement push functionality
- Handle
--include-localflag - Respect
push_localconfig setting - Push main worktree branch by default
- 4.3.3 Write tests for
push
- Handle
- 4.4.1 Create
merge.pycommand module - 4.4.2 Implement merge functionality
- Handle
<branch>parameter - Run
git mergein both trees - Apply branch alignment
- Handle merge strategy for ignored files
- 4.4.3 Write tests for
merge
- Handle
- 4.5.1 Create
rebase.pycommand module - 4.5.2 Implement rebase functionality
- Handle
<branch>parameter - Rebase main + local pair sequentially
- Maintain commit linkage
- 4.5.3 Write tests for
rebase
- Handle
- 4.6.1 Create
cherry_pick.pycommand module - 4.6.2 Implement cherry-pick functionality
- Handle
<commit>parameter - Apply commits to both trees
- Respect ignore scope
- Handle conflicts separately per tree
- 4.6.3 Write tests for
cherry-pick
- Handle
- 5.1.1 Create
drift.pycommand module - 5.1.2 Implement drift detection
- Handle optional
<pair>parameter - Compare commit hashes between trees
- Compare file differences
- Return exit code 1 if drift detected
- 5.1.3 Write tests for
drift
- Handle optional
- 5.2.1 Create
sync.pycommand module - 5.2.2 Implement synchronization
- Handle optional
<pair>parameter - Handle
--auto-commitand--dry-runflags - Copy missing files or commits
- Merge differences and commit results
- Support interactive and automatic modes
- 5.2.3 Write tests for
sync
- Handle optional
- 6.1.1 Create
status.pycommand module - 6.1.2 Implement combined status
- Handle
--shortand--verboseflags - Run
git status --porcelainfor each tree - Merge output with tree labels
- Label files with
LorGprefixes - 6.1.3 Write tests for
status
- Handle
- 6.2.1 Create
diff.pycommand module - 6.2.2 Implement diff between worktrees
- Handle
--name-onlyand--patchflags - Handle optional
<paths>parameter - Compare working dirs or HEADs
- Use
git diff --no-index - Include drift summary header
- 6.2.3 Write tests for
diff
- Handle
- 7.1.1 Create
pair.pycommand module - 7.1.2 Implement manual pairing
- Handle
<treeA>and<treeB>parameters - Validate both trees exist
- Update
.ddconfigwith new entry - Handle
--forceflag - 7.1.3 Write tests for
pair
- Handle
- 7.2.1 Create
unpair.pycommand module - 7.2.2 Implement unpairing
- Handle
<path>parameter - Remove pair entry from
.ddconfig - Handle
--keep-bothflag - 7.2.3 Write tests for
unpair
- Handle
- 7.3.1 Create
doctor.pycommand module - 7.3.2 Implement diagnostics
- Handle
--fixflag - Check tree existence and HEAD status
- Check commit alignment and config integrity
- Auto-fix missing local trees
- Generate health report
- 7.3.3 Write tests for
doctor
- Handle
- 7.4.1 Create
restore.pycommand module - 7.4.2 Implement tree restoration
- Handle
<tree>parameter - Handle
--from <pair>option - Rebuild missing/broken tree using partner's state
- Recreate
.gitignore-localand config - 7.4.3 Write tests for
restore
- Handle
- 8.1.1 Create
clone.pycommand module - 8.1.2 Implement paired cloning
- Handle
<url>and optional<dir>parameters - Handle
--branchand--no-localflags - Clone main repository
- Add paired local tree
- Initialize
.ddconfig - 8.1.3 Write tests for
clone
- Handle
- 8.2.1 Create
logs.pycommand module - 8.2.2 Implement log comparison
- Handle
--graph,--since,--untilflags - Compare
git log --onelineof each tree - Highlight divergent commits
- Optional visualization graph
- 8.2.3 Write tests for
logs
- Handle
- 8.3.1 Create
config.pycommand module - 8.3.2 Implement configuration management
- Handle
--get,--set,--listoperations - Read/write
.ddconfigentries - Manage suffixes, auto-sync options, push rules
- 8.3.3 Write tests for
config
- Handle
- 9.1.1 Create CLI interface using Click or argparse
- 9.1.2 Implement command routing
- 9.1.3 Add help system and usage information
- 9.1.4 Implement command validation and error handling
- 9.1.5 Write tests for CLI integration
- 9.2.1 Create
__main__.pyforpython -m ddworktree - 9.2.2 Create console script entry point
- 9.2.3 Test both entry methods work correctly
- 10.1.1 Create unit tests for all command modules
- 10.1.2 Create unit tests for utility functions
- 10.1.3 Create unit tests for core functionality
- 10.1.4 Mock Git operations for isolated testing
- 10.2.1 Create integration tests for command workflows
- 10.2.2 Test with real Git repositories
- 10.2.3 Test paired worktree operations
- 10.2.4 Test drift detection and sync operations
- 10.3.1 Create end-to-end test scenarios
- 10.3.2 Test complete workflows (create → modify → sync → commit)
- 10.3.3 Test error handling and edge cases
- 10.3.4 Test with different Git configurations
- 10.4.1 Ensure 80%+ test coverage
- 10.4.2 Generate coverage reports
- 10.4.3 Address any uncovered code paths
- 11.1.1 Create comprehensive README
- 11.1.2 Document all commands with examples
- 11.1.3 Create quick start guide
- 11.1.4 Document configuration options
- 11.2.1 Create API documentation
- 11.2.2 Document architecture and design decisions
- 11.2.3 Create contribution guidelines
- 12.1.1 Run all tests successfully
- 12.1.2 Test with different Python versions
- 12.1.3 Test with different Git versions
- 12.1.4 Performance testing with large repositories
- 12.2.1 Review and refactor code
- 12.2.2 Optimize performance bottlenecks
- 12.2.3 Add final error handling improvements
- 12.2.4 Create release artifacts
- GitPython for Git operations
- Click or argparse for CLI
- TOML or YAML parser for configuration
- pytest for testing
- Safe Defaults: Always respect
.gitignorescopes - Pair Consistency: Commands should mirror to pairs automatically
- Atomic Commits: Logically link commits across trees
- Extensible Design: Modular command structure
- Integration Ready: Works with pre-commit, CI/CD
- Test each command immediately after implementation
- Use mock Git operations for unit tests
- Use real Git repositories for integration tests
- Ensure comprehensive coverage of edge cases
- Verify that all tests pass at each milestone
Last Updated: 2025-10-07 Total Tasks: 12 main categories, 80+ specific subtasks