Datasheet

Revision Control System
Organizing your Lua scripts in a directory or directory tree makes it easier to reuse code that you have
written. It also simplifies your managing those scripts with a revision control system such as CVS or
Subversion. A revision control system enables you to do the following:
Recover an earlier revision of a script
Review the history of a script’s progress in the form of commit log entries
Safely develop scripts from more than one machine
Back up your work easily because only the repository needs to be backed up
Create and merge multiple sets of files known as branches to distinguish between the
installed and developmental versions of your scripts
One advanced system, Monotone, uses distributed repositories with Lua as a scripting language.
Revision control is usually associated with collaborative team efforts, but it has many benefits for the
independent programmer as well. The usual cycle is to edit and test your script until you reach some
sort of milestone, and then commit the script with a note to the revision control system’s repository.
Many well-written books and how-to guides exist for setting up and using open-source revision control
systems.
Summary
You now have a working Lua interpreter and compiler on your system.
In this chapter, you learned about the following:
Lua’s package structure
How to build Lua from scratch
How to install a precompiled Lua package
The advantages of a programmer’s editor
The advantages of a revision control system for your source code
You’ll use the various shell operations you learned about in the chapters ahead. When you extend Lua’s
functionality with libraries, you’ll use the same techniques to obtain and install the libraries as you did
in this chapter for Lua itself.
22
Chapter 1: Getting Situated
04_069172 ch01.qxp 1/2/07 7:53 PM Page 22