- Object storage:
- Blob: Store the content of a file
Blob.Serialize(), Blob.Hash()
- Tree: Store the content of a directory
Tree.Serialize(), Tree.Hash(), ParseTree()
- Commit: Store the content of a commit
Commit.Serialize(), Commit.Hash(), ParseCommit()
- Object compression using zlib
Repository.WriteObject(), Repository.ReadObject()
- Object validation and size limits
isValidObjectType(), ValidateHash()
- Cross-platform file metadata handling
getFileMetadata()
(linux.go/win.go)
- Blob: Store the content of a file
- Index:
- Store file metadata in the index
IndexEntry struct
- Store file content hash in the index
writeIndexEntries()
- Binary index format with versioning
WriteIndex(), ReadIndexFiles()
- Index checksum validation
ReadIndexFiles()
- 8-byte alignment padding
writeIndexEntries(), readIndexEntries()
- Store file metadata in the index
- Commit:
- Store commit metadata
NewCommit(), Sign struct
- Store commit message
Commit.Serialize()
- Support multiple parent commits
Commit.ParentHash[]
- Store tree hash
Commit.TreeHash
- Update HEAD reference
Repository.UpdateHEAD()
- Timezone handling in signatures
Sign.String()
- Store commit metadata
- Tree:
- Store directory structure
Tree.entries
- Support multiple file modes
isValidMode()
- Sort entries for consistent hashing
Tree.Serialize()
- Binary tree format
Tree.Serialize(), ParseTree()
- Tree entry validation
ParseTree()
- Store directory structure
- Repository:
- Initialize new repository
InitRepository()
- Write objects with SHA1 hashing
HashObject(), HashFile(), HashContent()
- Read objects with type validation
Repository.ReadObject()
- Add files to staging
Repository.AddFile()
- Commit changes
Repository.Commit()
- Update HEAD reference
Repository.UpdateHEAD()
- Initialize new repository
-
Remote Operations:
- Push to remote repository
Push()
(defined in interface) - Pull from remote repository
Pull()
(defined in interface) - Clone repository
Clone()
(defined in interface) - Fetch updates (not implemented)
- Push to remote repository
-
Branch Management:
- Create branches (not implemented)
- Switch branches (not implemented)
- Merge branches (not implemented)
- Delete branches (not implemented)
-
Log and History:
- View commit history
Log()
(defined in interface) - Show commit details (not implemented)
- Display file changes (not implemented)
- View commit history
-
Working Directory:
- Status tracking (not implemented)
- Dirty state detection (not implemented)
- Ignore patterns (.ggignore) (not implemented)
-
Recovery and Maintenance:
- Garbage collection (not implemented)
- Object verification (not implemented)
- Repository repair tools (not implemented)
-
Configuration:
- User settings (not implemented)
- Repository config (not implemented)
- Global config (not implemented)