Skip to content

Comment on Note the commit hashparent

Comments

Not random.

A Git commit is one kind of "object" in git. Objects in Git are hashed like so:

SHA1("[objecttype] [objectlen]\0[objectdata]")

and a commit object looks like this (blatantly stolen from the Stripe V3 CTF):

    tree #{tree}
    parent #{parent}
    author CTF user <me@example.com> #{timestamp} +0000
    committer CTF user <me@example.com> #{timestamp} +0000

    Give me a Gitcoin
The "tree" in the commit is the hash tree reference that actually points to your code.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.