How yacine204/cit works
cit is a small custom version-control tool: the user initializes a repository, then invokes a commit that snapshots tracked files and stores per-file changes and content in .cit. The main path is visible in main.c; README documents the snapshot format and exclusions. The sampled tree code shows recursive scanning and diff generation, while commit code loads and writes snapshots. The hash helper exists, but its call site was not shown, so no hashing relationship is asserted.
Main entry points: main.c CLI and initialization · tree.c Tree scanner · commit.c Latest commit loader · .cit `.cit` snapshots
Components 12
Command entry
- CLI and initialization
main.c
Snapshot construction
- Tree scanner
src/tree.c - File nodes
src/tree.c - Line diff
src/tree.c - Node hash helper
src/hash.c
Commit history
- Latest commit loader
src/commit.c - Snapshot parser
src/tree.c - Commit builder
src/commit.c - Tree serializer
src/commit.c - `.cit` snapshots
.cit
Other components
- User
- Working files
Connections 13
- User → CLI and initialization: invokes
README.md - CLI and initialization → `.cit` snapshots: initializes
main.c - CLI and initialization → Tree scanner: builds snapshot
main.c - Tree scanner → Working files: reads files
README.md - Tree scanner → Tree scanner: scans directories
src/tree.c - Tree scanner → File nodes: creates nodes
src/tree.c - File nodes → Line diff: generates changes
src/tree.c - CLI and initialization → Latest commit loader: loads history
main.c - Latest commit loader → `.cit` snapshots: reads latest
src/commit.c - Latest commit loader → Snapshot parser: parses snapshot
src/commit.c - CLI and initialization → Commit builder: creates commit
main.c - Commit builder → Tree serializer: writes tree
src/commit.c - Tree serializer → `.cit` snapshots: writes snapshot
src/commit.c