# Challenge:git stuck at last task

**URL:** <https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167>\
**Category:** Challenges\
**Tags:** challenge:git\
**Created:** [November 27, 2024, 10:47am UTC](https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167 "2024-11-27T10:47:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aimer101](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/aimer101/32/3177_2.png) [@aimer101](https://forum.codecrafters.io/u/aimer101)\
**Post date:** [November 27, 2024, 10:47am UTC](https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167/1 "2024-11-27T10:47:04Z")

</div>

Hi guys,

Im stuck at the last task of git challenge, how exactly is the structure of the bit for ref-delta and ofs-delta

from what i read on the docs it looks like this for ref-delta

\<sha[20]\>\<the\_instruction\_to\_build\_base\_object\>

but using go, if i do

offset + 20 + length of the instruction and move to next byte,  
the zlib reader gave me invalid header, meaning that the extracted data from ref-delta is not correct.

can you give me a hint for these 2 types, thanks,

also the test case is wrong imo because whenever i jsut skip the error, i pass the test, but im sure this is not the correct way

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [November 27, 2024, 5:15pm UTC](https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167/2 "2024-11-27T17:15:51Z")

</div>

Hi @aimer101, congratulations on reaching the final stage of the Git challenge! 🎉

To be honest, I actually don’t have the answer to your questions. 😅

This is one of our hardest stages, and we plan to split it up and add proper instructions at some point.

---

<div class="post-metadata">

**Author:** ![aimer101](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/aimer101/32/3177_2.png) [@aimer101](https://forum.codecrafters.io/u/aimer101)\
**Post date:** [November 28, 2024, 8:34am UTC](https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167/3 "2024-11-28T08:34:56Z")

</div>

I recently submitted my implementation for review, and I wanted to highlight a couple of specific issues:

1. The current test cases do not account for scenarios where the object type is `ofs-delta`. This might result in incomplete coverage and should be addressed to ensure robust testing.
2. There’s an issue with processing the last object in the packfile. I’ve left a comment in the code noting the problem:

```auto
// todo
// for some reason
// the last object cannot be processed by zlib

```

Despite these challenges, I thoroughly enjoyed working on this task. It was a rewarding experience that deepened my appreciation for the intricacies of data compression and bitwise operations. I gained a newfound respect for how every bit in a byte can carry significance, and the elegant engineering behind compression algorithms, such as the opcodes for copying and inserting, truly stood out to me. It’s a remarkable example of engineering ingenuity at work.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [December 4, 2024, 12:44pm UTC](https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167/4 "2024-12-04T12:44:07Z")

</div>

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [December 9, 2024, 12:44pm UTC](https://forum.codecrafters.io/t/challenge-git-stuck-at-last-task/3167/5 "2024-12-09T12:44:36Z")

</div>

Closed on December 9, 2024, 12:44pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
