Skip to content

kiritocode1/gigi

Repository files navigation

Core Storage

  • 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)

Index Management

  • 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()

Commit Operations

  • 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()

Tree Operations

  • 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()

Repository Management

  • 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()

Work in Progress

  • 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)
  • 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)

Additional Features Needed

  • 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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published