Challenge:git stuck at last task

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

1 Like

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

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

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

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:
// 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.

2 Likes

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

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