657 B
657 B
- k: Print refs
Now that we have refs and a potentially branching commit history, it’s a good idea to create a visualization tool to see all the mess that we’ve 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).
We’ll create a new k command in cli.py. We’ll
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, let’s just print
all refs when running k.