Revision Control with Arch: Maintenance and Advanced Use
The tla replay command can be used for more powerful operations than a simple undo. One of the more compelling features of Arch is the ability to cherry-pick particular changesets from a remote archive without having to apply changes you don't need.
Consider the project, foo, maintained by Bob. Bob keeps a stable branch of the project (foo--stable) and an experimental branch (foo--experimental). All releases are generated from the stable branch—foo--stable--2.4.2 being the most recent. The experimental branch is where adventurous new features are made available in a somewhat official location.
Alice plans to work on some experimental code, so she tags off Bob's experimental branch to work in her own space:
$ tla my-id "Alice B. Hacker <email@example.com>" $ tla make-archive -l firstname.lastname@example.org \ sftp://email@example.com/home/abh/public_html/arch $ tla archive-setup foo--hackery--0.0 $ tla register-archive http://entar.net/~bob/fooarch $ tla tag \ firstname.lastname@example.org/foo--experimental--0.0 \ email@example.com/foo--hackery--1.0
In the process of working on her experimental features, Alice discovers a bug that Bob must have overlooked. The fix is simple, so she puts her current work aside with tla undo and checks in the fix:
$ tla undo $ vi buggy_file.c another_buggy_file.c $ tla commit M buggy_file.c M another_buggy_file.c * committed firstname.lastname@example.org/foo--hackery--1.0--patch-9 $ tla redo
Alice soon finishes her changes and tells Bob where her archive lives. Bob decides that her code is acceptable for the experimental branch and star-merges it in:
$ tla get email@example.com/foo--experimental--0.0 $ cd foo--experimental--0.0/ $ tla register-archive http://zork.net/~abh/arch/ $ tla star-merge \ firstname.lastname@example.org/foo--hackery--1.0
While reading Alice's changelog, Bob realizes the bug she fixed exists in the stable branch as well. Because he doesn't want to grab all of the experimental code from her hackery branch, Bob cherry-picks only the changeset that contains the bug fix:
$ tla get email@example.com/foo--stable--2.4.2 $ cd foo--stable--2.4.2/ $ tla replay \ firstname.lastname@example.org/foo--hackery--1.0--patch-9
Alice and Bob were able to work together despite the fact that neither developer shared access to a single system. Neither developer had set up any sort of dedicated server; they were able to use standard stock protocols such as HTTP, SSH and SFTP. Alice's archive had the advantage of being accessible from a Web directory on the Internet, just as Bob's official archive was.
Arch provided the tools for Alice and Bob to manipulate their two separate archives, and the differences between them, using nothing more exotic than Apache and OpenSSH.
Sending so much code over the Internet always has made free software developers at least a little nervous, even if only in the back of their minds. The current system of peer review seems to have solved the problem of malicious code submissions quickly and effectively, but it would help to be able to identify each changeset's author beyond a reasonable doubt.
Arch allows developers to sign their changesets cryptographically, allowing verification of submitter identity through a web of trust. Although this does not conclusively prove the intentions of the developer in question, it raises the bar for forged submissions.
To use cryptographic signatures in Arch, you first must generate a GnuPG key.
$ gpg --gen-key
Unfortunately, signed archives are somewhat different functionally from the unsigned variety. This makes it necessary to keep a separate archive for signed commits. Running tla make-archive with the -s switch creates an archive capable of storing GnuPG signatures:
$ tla make-archive -ls email@example.com \ ~/SIGNED-ARCHIVE $ tla my-default-archive firstname.lastname@example.org
Finally, a few configuration files must be created in order for Arch to sign changesets and verify signatures. First, an awk script included in the tla distribution, called gpg-check.awk, must be installed somewhere on the system where Arch is run. The Debian tla packages install it to /usr/bin/tla-gpg-check by default. In order for Arch to verify signatures, the file ~/.arch-params/signing/=default.check should contain a single line that reads:
$ mkdir ~/.arch-params/signing/ $ echo \ 'tla-gpg-check gpg_command="gpg --verify-files -"'\ > ~/.arch-params/signing/\=default.check
If you want keys to be downloaded automatically from a public keyserver as needed, you can add parameters such as --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve to the gpg_command. This causes Arch to download keys from pgp.mit.edu as needed and verify the signatures in an archive against these keys during the get or update operations.
For Arch to sign changesets automatically that you commit to an archive created with the -s option, the ~/.arch-params/signing/=default file must be one single line like the following, substituting the address you used when you created your key:
$ echo \ 'gpg --default-key "<email@example.com>" --clearsign' \ > ~/.arch-params/signing/\=default
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Nice article, thanks for the
4 hours 48 min ago
- I once had a better way I
10 hours 34 min ago
- Not only you I too assumed
10 hours 51 min ago
- another very interesting
12 hours 44 min ago
- Reply to comment | Linux Journal
14 hours 38 min ago
- Reply to comment | Linux Journal
21 hours 32 min ago
- Reply to comment | Linux Journal
21 hours 48 min ago
- Favorite (and easily brute-forced) pw's
23 hours 39 min ago
- Have you tried Boxen? It's a
1 day 5 hours ago
- seo services in india
1 day 10 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?