Files
DIY_GIT_in_Python/how_to/Change_29.md

493 B
Raw Blame History

  • log: Use iter_commits_and_parents

Refactoring ahead! Since we have iter_commits_and_parents from k, lets also use this function in log. Well need to adjust it a bit to use collections.deque instead of a set so that the order of commits is deterministic.

This generalization might seem unneeded at this point, but it will be useful later. (Note for the advanced folks: When we implement merge commits that have multiple parents, this generic way to iterate will come in handy.)