Subversion UI Shootout
Pages: 1, 2, 3
GUI Principle #2
GUIs are superior when they make performing a specific task more
obvious. An example of this among the SVNs is diffing between revisions of
a file. In Tortoise, it is just a matter of looking at the log, selecting two
log entries, and selecting "Compare Revisions." In the CLI, I had to do a
svn help diff first before figuring out that the syntax I needed
was svn diff -r <old version>:<new version>.
log
The log command displays commit messages for specific revisions of a
file.
- CLI
-
The command to show all log entries for all revisions of a particular file is as follows:
[jjones@cerberus folder1]$ svn log tttt.txt ------------------------------------------------------------------------ r3 | (no author) | 2004-12-08 14:43:19 -0500 (Wed, 08 Dec 2004) | 1 line test test test ------------------------------------------------------------------------ r2 | (no author) | 2004-11-27 18:27:21 -0500 (Sat, 27 Nov 2004) | 1 line had to move some stuff around. ------------------------------------------------------------------------ r1 | (no author) | 2004-11-27 18:26:18 -0500 (Sat, 27 Nov 2004) | 1 line This was another test. ------------------------------------------------------------------------ - RapidSVN
- The mouse right-click and Rapid "query" menus contain the
logcommand. Rapid has a limitation in that it does not appear to show the verbose log output that includes all the other files that changed in that particular commit. - TortoiseSVN
- As with all its other major features, the mouse right-click menu in Windows
Explorer contains the
logcommand. Unlike Rapid, Tortoise provides the verbose log output when the user selects a revision.
It is comparatively simple to obtain the desired log messages in any of the
three SVN clients (with the obvious missing functionality in Rapid). As with
the diff command, it is easier to retrieve log information for previous
revisions using GUI clients.
commit
The commit command updates the SVN repository with changes made to a local
repository.
- CLI
-
The following command updates the remote repository with changes made to test_cli.txt and tttt.txt:
[jjones@cerberus cli_co]$ svn commit Adding folder1/test_cli.txt Sending folder1/tttt.txt Transmitting file data .. Committed revision 6. CLI SVN test. --This line, and those below, will be ignored-- A folder1/test_cli.txt M folder1/tttt.txt - RapidSVN
- In order to commit changes from within RapidSVN, right-click on the desired
file or directory and select
commit. A window will appear requesting a log entry for this particular change. - TortoiseSVN
- Make a commit in Tortoise by right-clicking on a file or directory in
Windows Explorer and selecting
commit. Unlike the other two clients, Tortoise does not automatically assume that you wish to commit all files pending commit. (Selecting a directory to commit in any of the clients implies that you intend to commit changes made to all files under that directory.) A log message window appears in order to track changes made to the selected files. However, a checklist of changed files also appears, so that you can select (or de-select) individual files to commit. Further, double-clicking on a file in the checklist willdiffthe file and show the changes made since the last commit.
Committing files is equally simple among the three clients. However,
Tortoise added some features that are really useful. It's really nice to be
able to select a top-level directory, start a commit, and then hand pick the
files you want to commit. It's also nice while trying to determine which files
to commit to be able to diff them with a double-click. These features were well
thought out and have helped me along the path of programmer virtuosity by
making me just a bit lazier.
GUI Principle #3
GUIs are superior for executing an action against a subset of a list of
items that requires a human brain for its creation. If you have a
command, such as svn status, that will generate a list of items and
need to commit some, but not all, of the files in the resultant list with a
criteria that you cannot easily programmatically derived (such as "Oh, I was
only fooling around with this file; it doesn't need to be committed," or "The
changes in this file are for next build, not this build, so I'd better not
commit them yet"), it is easier to have a list of items to select or deselect
with a mouse click rather than, in this case, performing a commit one file at a
time.
GUI Principle #4
GUIs are superior when you want to perform a limited number of functions
on a list of items. An example is: "What do you want to do with a list of
files in a potential commit operation?" The only things that I can think of are
to diff the files with the latest repository version to see what changes have been
made locally, and revert specific files back to the repository revision.
Tortoise includes these options, as well as the ability to open the files. Doing a diff on
a specific file is available (as mentioned in this article several times,
because that is an awesome feature!) with a double-click on the file.
update
The update command synchronizes a local repository with the server
repository.
- CLI
-
In order to update the local repository to the current SVN version (using the CLI), issue a command like the following:
[jjones@cerberus svn]$ svn update cli_co/ At revision 3. - RapidSVN
- Updating a local repository (or a specific directory tree) in Rapid involves right-clicking on a file or directory and selecting "update." In the update dialog that immediately appears, an "update to specific version" option is available, as well as the ability to choose whether to perform a recursive update.
- TortoiseSVN
- Updating in Tortoise involves right-clicking on a directory or file and selecting Update. No options are available in that menu. However, there is an Update to Revision function in the a TortoiseSVN menu, which should overcome that shortcoming.
The update command is comparable across these three clients.
add
The SVN add command adds a file, directory, list of files or directories, or
a recursive directory tree to a local repository. The changes made to the
local repository will not be made to the server repository until they are
committed.
- CLI
-
The following command adds the file test_cli.txt to the local repository:
[jjones@cerberus folder1]$ svn add test_cli.txt A test_cli.txt - RapidSVN
- Add a file to the local repository from Rapid by right-clicking on the file (or directory) and selecting "add."
- TortoiseSVN
- Add a file to the local repository from Tortoise by right-clicking on the file (or directory) from Windows Explorer and selecting "add." Tortoise does have the extra bonus feature of providing a checklist to select which files to really add.
In all three clients, it is simple to add files and directories. The CLI does have the advantage that the full power of the shell is available.
CLI Principle #1
CLIs are superior when processing the result of something with another utility is helpful. For example, to add all .txt files recursively, do something like this:
for f in `find . -name "*.txt" -print`
do
svn add "$f"
done
move
The move command relocates a file or directory in the repository. One of the
benefits of a Subversion move as opposed to an attempt to perform the same
thing in CVS is that Subversion maintains the revision history of the moved
files. There are ways to maintain this history in CVS as well, but when I last
looked into doing it (a year or so ago), it seemed painful.
- CLI
-
The following command moves the file test_cli.txt up one directory level:
[jjones@cerberus folder1]$ svn mv test_cli.txt ../ A ../test_cli.txt D test_cli.txtInterestingly, the
movecommand is equivalent to doing a copy followed by a delete. - RapidSVN
- Perform a
movecommand in Rapid by right-clicking on a file or directory, selecting "move," and typing in the desired destination. - TortoiseSVN
- Move a file in Tortoise by right-dragging it to the desired destination and selecting "Move files in Subversion to here" from the resulting menu.
The two easiest options for moving files are the CLI and Tortoise. With the CLI, a good shell that supports tab completion makes it a snap to find the desired destination. With Tortoise, navigating to the desired destination is just a matter of expanding directory trees. Rapid, though, is just not terribly friendly in this regard. Maybe I've just grown lazy over the years, but having to type a full directory path to somewhere without the crutch of auto-completion is just a little more tedium than I care to needlessly inflict upon myself.