How jcoglan/jit works
This is a Ruby implementation of a Git-like version-control tool. Its central workflow is manipulating a working tree and staging area, recording changes as repository objects and commits, then inspecting or transferring repository history. The graph preserves the documented-by-tree command families—branching, history, merging, and remotes—alongside storage and diff internals. Source excerpts confirm the repository’s state components, status and merge behavior, object storage, and remote protocol client; wiring among unsampled command handlers is intentionally limited.
Main entry points: command.rb Command entry · repository.rb Repository API · migration.rb Tree migration · resolve.rb Merge resolution
Components 25
User commands
- Command entry
lib/command.rb - Stage changes
lib/command/add.rb - Create commit
lib/command/commit.rb - Status command
lib/command/status.rb - Checkout
lib/command/checkout.rb - Merge command
lib/command/merge.rb - Diff command
lib/command/diff.rb - History commands
lib/command/log.rb
Repository state
- Repository API
lib/repository.rb - Staging index
lib/index.rb - Working tree
lib/workspace.rb - Refs and branches
lib/refs.rb - Configuration
lib/config/stack.rb - Status analysis
lib/repository/status.rb - Tree migration
lib/repository/migration.rb
Objects and changes
- Object database
lib/database.rb - Pack storage
lib/pack.rb - Diff engine
lib/diff.rb - Merge resolution
lib/merge/resolve.rb
History and remotes
- Fetch and push
lib/command/fetch.rb - Remote client
lib/command/shared/remote_client.rb - Remote protocol
lib/remotes/protocol.rb - Remote config
lib/remotes.rb
Other components
- CLI user
- Remote repository
Connections 33
- CLI user → Command entry: invokes
- Command entry → Stage changes: dispatches
- Command entry → Create commit: dispatches
- Command entry → Status command: dispatches
- Command entry → Checkout: dispatches
- Command entry → Merge command: dispatches
- Command entry → Diff command: dispatches
- Command entry → History commands: dispatches
- Command entry → Fetch and push: dispatches
- Repository API → Object database: creates
- Repository API → Staging index: creates
- Repository API → Refs and branches: creates
- Repository API → Working tree: creates
- Repository API → Configuration: creates
- Repository API → Remote config: creates
- Status command → Staging index: loads and writes
- Status command → Status analysis: requests status
- Status command → Refs and branches: reads branch
- Repository API → Status analysis: constructs
- Repository API → Tree migration: constructs
- Tree migration → Working tree: applies changes
- Tree migration → Staging index: updates
- Tree migration → Object database: loads blobs
- Merge resolution → Object database: diffs and stores
- Merge resolution → Tree migration: applies clean changes
- Merge resolution → Staging index: records conflicts
- Merge resolution → Working tree: writes files
- Object database → Pack storage: uses storage backends
- Fetch and push → Remote client: uses client
- Fetch and push → Remote config: reads remote settings
- Remote client → Remote protocol: creates connection
- Remote client → Remote repository: starts agent
- Diff command → Diff engine: uses diff engine