Demonstrating Git with Perl

Git is the latest and greatest amongst version control systems.  Git is:

a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
Git is used for version control of files, much like tools such as Mercurial, Bazaar, Subversion, CVS, Perforce, and Visual SourceSafe.

But how do you persuade your boss, friend, co-worker, …. that it is so much better.  You can rant and rave about how quick, compact and cool it is till the cows come home, but they probably won’t be converted until they see it live in action, and that often takes time…  And in a slide show presentation you don’t want to wander off hacking at the console changing files and cd-ing directories just to show checking in/out a few files…

Along comes Git::Demo – a Perl module to allow you to write stories about Git, and then play them back to your friends, colleagues and bosses to your hearts delight, showing off the snazzy coolness of git.

A Git::Demo story is written in YAML (that’s like XML, but easier to write/read), and has characters:

characters:
- name: Bob
- name: Mary
- name: Jane
- name: Peter

It has events:

- type: print
  action: screen
  characters: ALL
  args:
  - Yippee - go-go-Git!

And those events can be print (prints to screen), “git”, or “file” events

- type: git
  action: remote
  characters: ALL_NOT origin
  args:
  - add
  - origin
  - ../origin

By writing a story of events carried out by the characters, you can show live (and with wallclock times) how quick and easy Git actions are, and you’re not just doing a “here’s one I did earlier” show: it’s happening live at that very moment, so if your viewer says “Wait a moment, what happens now if I …?”, you can pause the story, and do it right there and then.

Git::Demo is still pretty rough, and my sample scripts are short and not so cool yet… but I’m hoping that this will catch the eye of other Git-Lovers out there, and that some will help improve the code, and write more stories!

Have fun, and use Git! 🙂


You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

2 Responses to “Demonstrating Git with Perl”

  1. brian d foy Says:

    This looks very interesting, especially if you can turn the script into movies or animations.

    Just a note, though. Git doesn’t care about files. It cares about content. That’s one of the features that makes it more flexible than the systems that track files.

  2. Movies or animations will probably require a screen grabber in addition, but I don’t think that’s a problem.
    True Git only sees the content, but the characters in the story should generate file diffs: so the application would be able to show up just these differences between user experience, and how it actually works under the hood.