Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 2.36 KB

File metadata and controls

37 lines (29 loc) · 2.36 KB

gitbean Progress

Milestones

  • init — creates .gitbean/ structure (objects/, refs/heads/, refs/tags/, HEAD)
  • hash-object — hashes + stores blobs, byte-compatible with real Git (verified: hashes match)
  • cat-file -p / -t / -s — reads an object back out, decompresses, parses header, prints content/type/size
  • add — staging area / index (simplified text format for now, see notes below)
  • write-tree — binary tree object serialization
  • commit-tree / commit — commit objects + refs
  • log — walk parent pointers
  • status — diff working dir vs index vs HEAD
  • branch / checkout — ref manipulation

Verified compatibility with real Git

Date Check Result
2026-07-15 hash-object Confirmed matching SHA-1 for identical file content
2026-07-15 cat-file -p Confirmed real git cat-file -p <hash> can read objects written by gitbean

Commands implemented so far

Command Description
gitbean init Sets up the repo structure
gitbean hash-object [-w] <file> Hashes a file as a blob; -w also stores it
gitbean cat-file -p <hash> Prints an object's content
gitbean cat-file -t <hash> Prints an object's type
gitbean cat-file -s <hash> Prints an object's size
gitbean add <file> Hashes + stores a file as a blob, stages it in the index

Notes on add / index

  • Using a simplified plain-text index format for now (<hash> <filename> per line), not real Git's binary index format.
  • Decision made deliberately: the interesting/hard part of Git internals is trees/commits/history, not staging-file-format parsing. Revisit the binary format as its own milestone later if desired.
  • See OBJECT-FORMAT.md for the exact index format details.