DIY_GIT_in_Python/how_to/Change_17.md

373 B

  • log: Implement

log will walk the list of commits and print them.

We will start by implementing get_commit() that will parse a commit object by OID.

Then in the CLI module we will start from the HEAD commit and walk its parents until we reach a commit without a parent.

The result is that the entire commit history is printed to the screen once we run ugit log.