With commit wired into HEAD, a second commit just works: it picks up the first as its parent and moves the branch forward. Today you make that second commit and watch history grow by one link.
Make a second commit that links to the first and advances the branch.
This lesson should need almost no new code, and that is the point. Because the
commit porcelain already takes its parent from HEAD and advances the branch, a
second commit falls out for free: staging the changed hello.txt gives a new blob
and a new root tree, and committing picks up f18e98d3... as the parent, producing
9bae7f0a... and moving main to it. If your machinery is right, you write a test
and it passes.
That is a satisfying “it just works” moment worth pausing on: you now have a real,
growing history, a chain of commits each pointing at its predecessor, each an
immutable content-addressed snapshot, with a branch label tracking the tip. The
only thing left to make this feel like Git is to walk that chain, which is exactly
what log does next.
// no new code should be needed: the parent-from-HEAD and branch-move// logic from the last lesson does exactly thisr.Add(ix, "hello.txt") // hello.txt -> 3b18e512...id, _ := r.Commit(ix, ident, "Update greeting\n")// id == "9bae7f0a71d91d794187cf9de39901bfbfbfc7b6"; main advanced