Files
DIY_GIT_in_Python/how_to/Change_26.md

657 B
Raw Blame History

  • k: Print refs

Now that we have refs and a potentially branching commit history, its a good idea to create a visualization tool to see all the mess that weve created.

The visualization tool will draw all refs and all the commits pointed by the refs.

Our command to run the tool will be called ugit k, similar to gitk (which is a graphical visualization tool for Git).

Well create a new k command in cli.py. Well create iter_refs which is a generator which will iterate on all available refs (it will return HEAD from the ugit root directory and everything under .ugit/refs). As a first step, lets just print all refs when running k.