How To Use Gnu Arch

Table of Contents


arch is a Version Control System (VCS).

I suggest you move to git instead.

Register an ID to use Arch

$ tla my-id "FirstName LastName <email@address>"

Register An Archive Location

$ tla register-archive
Registering archive:

List Registered Archives

$ tla archives

Setting The Default Archive

$ tla my-default-archive

Get a project

$ tla get bzmap--main

Commit change

First create a log file with:

$ vim `tla make-log`
[tla make-log outputs a filename to edit.]

then commit the change:

$ tla commit
* imported

Full example to add and commit some files (here just the README file):

fred@mau ~/projects/bzmap--main--0.1--base-0 $ vim README
fred@mau ~/projects/bzmap--main--0.1--base-0 $ tla add README 
fred@mau ~/projects/bzmap--main--0.1--base-0 $ vim `tla make-log`
fred@mau ~/projects/bzmap--main--0.1--base-0 $ cat theFilenameReturnedByTlaMakeLog
Summary: Added a README file

Added a README file. Mainly to test arch.
fred@mau ~/projects/bzmap--main--0.1--base-0 $ tla commit
A  .arch-ids/
* update pristine tree ( => bzmap--main--0.1--patch-1)
* committed
fred@mau ~/projects/bzmap--main--0.1--base-0 $  

Creating and Using Mirror Archives

I like to have the original source archive registered with it's regular name. The mirror archive is then registered under a different name.

The mirror archive can be one of two types:

  • Push mirror (you copy data from a local source archive to a remote mirror of the archive)
  • Pull mirror (you copy data form a remote source archive to a local mirror)

Push Mirrors

Register your source archive

$ tla register-archive /home/bernt/{archives}/2005-laptop

Register the mirror archive to copy to

$ tla register-archive

To update the mirror use

$ tla archive-mirror

Pull Mirrors

Register your direct access to the source mirror

$ tla register-archive

Now register your mirror archive

$ tla register-archive

Reregister the source archive as the mirror source archive

$ tla register-archive

This allows you to commit changes to the remote source archive when you have internet access to it. It also allows you to tag changes from your local mirror when the source is unavailable. You can then commit changes to your local work archive and later update the source mirror when it is available.

Update the mirror from the source using

$ tla archive-mirror

Update the Mirror Archive

Finally, copy data from the remote archive:

% tla archive-mirror

Creating a New Project

# creating a new project
mkdir niftyprogram && cd niftyprogram
tla init-tree niftyprogram--mainline--0.1 # make this a project tree
vim              # make files
vim README                       #
tla add README   # tell tla these are source
tla tree-lint                    # make sure nothing was forgotten
tla import -S                    # create niftyprogram--mainline--0.1--base-0

Creating a Branch

To branch a project to tag an existing archive into a new project.

If you have an existing project proj1--main--1.0.0 that you want to branch into proj1--main--1.1.0 create the new project as a tag from the old project.

tla tag -S proj1--main--1.0.0 proj1--main--1.1.0

You then check out proj1–main–1.1.0 into a new project directory and work on the files normally.

Author: Bernt Hansen