forked from Tonio2/hetic_git
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Max edited this page Jul 24, 2025
·
12 revisions
Welcome to the Guts wiki!
Consigne
- Creates a blob object from file content and writes its SHA-1 to stdout.
- ❌ Reject directories or missing files.
-
-t: Print object type. -
-p: Pretty-print blob/tree/commit content. - ❌ Reject invalid OIDs or missing options.
- Create a tree object from the staging area.
- Writes SHA-1 of the tree to stdout.
- Creates a commit object pointing to a tree (and parent commit if any) and writes its oid to stdout
- Requires
-mmessage. - ❌ No annotated tags.
- Initializes a Git repository in the given directory.
- Create .git/objects, .git/refs/heads, HEAD, and minimal config
- Adds files to the staging area (not directories).
- ❌ No
-p, no wildcards.
- Removes a file from working directory and index.
- Runs
write-tree, creates a commit with HEAD as parent. - ❌ No editor or message prompt.
- Shows staged and unstaged changes.
- Switch to existing commit or branch.
-
-b <branch>creates a new branch. - Change HEAD, update working dir, check for conflicts
-
--soft: move HEAD -
--mixed: + reset index -
--hard: + reset working directory - ❌ No file-specific reset.
- Print commit history from HEAD (one-line summary ok).
- List all files in the index.
- List contents of a tree object.
- Convert ref/branch/HEAD into SHA-1.
- ❌ No complex selectors
- List all refs and their hashes.
- Perform 3-way merge and create a merge commit with 2 parents.
- On conflict: insert
<<<<<<<,=======,>>>>>>>markers into file(s). - ❌ No rebase, squash, or fast-forward-only merges.
- Handle
.gitignore - Use simple glob-style matching (e.g.,
*.log,build/) - ❌ No negation or nested
.gitignorefiles.
- You are free to implement the index your way.
- ✅ Bonus if it matches Git’s format closely.
-
git pushandgit update-indexare NOT required. - No support for remotes, rebase, tags, or stashing.
- A working implementation of the listed commands.
- Tests and example usage for each.
- Clean error handling for all unsupported cases.
- Total time: 6–9 days
- Use AI if needed, but understand what you're coding.