It took me 683 commits to write the first draft of Effective Python over the course of 132 days (~4 months). That includes all the work for tools I built, the website, notes, and code examples. I've been storing the content in a private GitHub repo. Here are some fun metrics from it.
Commit density by day:
The majority of my commits are on the weekends.
Commits per week:
I was offline quite a lot in September.
Commits by hour of day / day of week:
Clearly I have been staying up way too late working on this thing.
What will be interesting is how many commits it takes to do revisions and get the book into a publishable state.