cfv [global_options] {command} [command_options] [command_arguments]
cfv [--version]
cfv [--help]
This manual page documents briefly the cfv command, version 0.4.4.
cfvers is a version control system designed for the management of configuration files in Unix-like operating systems..
cfv is the command-line client used to register files into cfvers, restore them, display information about the contents of the repositories, etc.
cfv provides several command for working with files and repositories, each of them having their options. The most used of them are:
Stores a new version of item into the repsository. If item is not already in the repository, cfv registers it first.
Retrieves an item from the repository. If it denotes a directory, all items registered in the repository underneath it are restored.
These options follow the usual GNU command line syntax, with long options starting with two dashes (`-'). cfv has two classes of options: global options and command options.
These are the global options to cfv
Show summary of options.
Show the version of the program and copyright information.
Selects the repository to be used. By default, the repository is taken from ~/.cfvers or /etc/cfvers.conf. The repository name must conform to the following format: database:connect_string. For more informations, see the user manual.
Selectes the area to be used. By default, the area used is the one called 'default'.
Here are the brief descriptions of the cfv commands:
Shows the contents of a item from the repository. For regular files, this will be the contents of the file, while for other type of items this will be a textual representation of the item.
Shows differences between the contents of the repository and the filesystem, or between versions in the repository for the arguments. The items are checked in differences in both data and metadata.
Exports the contents of the repository either in "tar" or "sha1sum" format.
Searches the contents of the repository.
Show the changelog of the revision(s) selected. By default, show the full changelog of all versions.
Retrieve some or all items from the repository.
Show information about the metadata of selected items, like the stat command-line utility from GNU coreutils.
Stores or adds items to the repository. If the items named are already in the repository, store a new version for them (if they are different). If not, register them first and them store their first version.
This section describes the command_options that are available across several cfv commands. Not all commands support all of these options; each option is only supported for commands where it makes sense. However, when a command has one of these options you can count on the same meaning for the option as in other commands. (Other command options, which are listed with the individual commands, may have different meanings from one command to another.)
Selects the revision(s) to operate on. When a revision number is needed, a single number should be given. When two revisions are needed, they should be given separated by a colon (:).
Here (finally) are details on all the cfv commands and the options each accepts.
cat [-rREVNO] {ITEM}
Show the data contents of the specified ITEM. By default, the latest version of the items is given; a different version can be selected by using the -r option, with a single revision number.
The data contents is defined as:
The contents of the file.
The contents of the directory, formatted as in ls -1A.
The target of the symlink.
N/A
diff [-rREVNO] [-l] {ITEM...}
Shows the difference between two versions of the arguments given. By default, the diff is made between the latest revision in the repository and the current version (in the filesystem).
The diff command can also be used to check which items have been modified, by using the -l. In this case, the output will just contain the names of the items which are different between the revisions selected, one item per line.
For each item, the diff output has two parts, each optional. If the item's version differ in data contents, an unified diff over the two versions will be shows. If the versions differ in metadata, an unified diff over a textual representation of the metadata will be shown.
export [-r[REVFIRST:]REVNO] [-FFORMAT] [-oFILENAME]
Exports the content of the repository. The export format can be "tar" or "sha1sum" (the default).
The contents of the repository can be exported at a certain revision, using the -rREVNO (which includes also older items modified before that revision); or with an exact set of revisions, with the -rREVFIRST:REVNO, which includes only the items changed in those revisions.
The output destination can be specified with the -o option. The default is standard output, which cand also be specifically denoted using "-" as the destination.
find [-l] [-d] [-rREVNO] [--name=SHELL-GLOB] [--regex=REGEX]
The find command searches the contents of the repository.
Tests available:
select only the items which are available in revision N by using the -rN options (note that this selects all items with revisions <=N).
select only items which have a certain name by using the --name=SHELL-GLOB option or the --regex=REGEX option. These options filter on the filename using either a shell glob (see glob(7)) or a regular expression (see regex(7)). Note that these options as additive, i.e. if both given they will both filter, making the output more restrictive.
Output control: by default, the listing format is one item name per line, but it can be changed using the options -l and -d.
The -d show an expanded format with informations like:
------------------------- Item: id #1, name /etc Created at: 2003-10-13T21:33:17+0 Has revisions: [1,] ------------------------- Item: id #92, name /etc/.pwd.lock Created at: 2003-10-13T21:33:18+0 Has revisions: [1,2]
The -l option shows an 'ls -l' like format, with the following fields:
mode representation (e.g. -rwxrwxrwx)
number of revisions in the repository
owner registered in last version
group registered in last version
size of item's last version
time, in ISO format: YYYY-MM-DD HH:MM:SS
name
log [-rREVNO[:REVNO]] {ITEM...}
The log command shows the log messages of the repository. By default, the full log is shown, however you can restrict the log to a revision or a range of revisions using the -r option with one or two arguments. The one argument form will restrict the output to only one revision, while the two-argument form will restrict the output to all revisions between those given (inclusive).
You can also restrict the log messages to some items by giving them as arguments to the command.
The final set of the revisions show is the intersection of the set of selected revisions (using -r) and the set computed as the union of the revisions numbers of the items given.
retrieve [-rREVNO] [-dDIRECTORY] [-n] [-s] [-q] {ITEM...}
The retrieve command restores the given items to the filesystem. By default, the latest version in the repository is restored; use -rREVNUM to restore another version.
A message is shown for each item restored; this can be disabled using the -q option.
By default, the items are restored to their original location; this behavior can be modified using the -d and -s switches.
Also by default, any items given which are directories will be processed recursively, restoring all items which can be reached starting with them. To disable this behavior, use the -n option.
The -dDIRECTORY option can be used to change to top directory of the restore process: for example, the item /etc/passwd can be restored under /tmp/etc/passwd by giving the option -d/tmp.
The -s option can be used to disable the restoration of paths from the filenames. With the above example, to restore the file /etc/passwd to /tmp/passwd you can use the command line cfv -d/tmp -s /etc/passwd. Note that using just -s alone, all files will be restored under /.
Note that the estoration process will not be able to restore the ctime of any items. This is by design in the POSIX filesystem layer: the ctime is for metadata modifications, and the mtime/atime pair for data write/read accesses. Thus a ctime modification would trigger a ctime modification, since the ctime itself is part of metadata, rendering useless the ctime modification :). A read attribute for the metadata would be innapropriate, IMHO, because such reads are made in a great amount. The list of other restrictions in the restore process follows:
These files will have almost all attributes restored. Of course, devices files restoration won't restore your devices :-)
The restoration of directories is special, since they are non-leaf items. All other types currently supported by cfvers are leaf items and thus can be restored fully by themselves. However, the content of directories cannot be restored if it hasn't been stored in the repository.
Also, the mtime attribute of directories is not currently restored correctly, since the order of restoration is important: it should be depth first, but the parent directories need to be created first. To fix this, we need to make a double pass - currently all restores are one-shot.
The problem with simbolic links is that POSIX doesn't specify functions to set some attributes of the symbolic links themselves: for example, utime(2)
or utimes(2)
always act on the symbolic link target. Also, the chown(2)
doesn't work on symbolic links. The owner/group can be changed, though, using the lchown
function.
These are not restored, as they don't contain any payload, and they are usually created by the application at startup time.
stat [-rREVNO] [ITEM...]
The 'stat' command displays information about the metadata of the given items (or all items in the repository), as recorded when they were stored in the repository.
By default, information about the latest revision is given, however you can select a certain revision by passing the -rREVNO option.
The output is formatted to look like the output of the command line utility stat from GNU coreutils.
store [-n] [-mMESSAGE] [-cCOMMITER] [-q] {ITEM...}
The store command adds some new items to the repository or stores a new version of the items, if they have been modified. Note that if none items can't be read, the operation will abort; with at least one item successfully read, the operation will continue, generating warnings for items with problems.
A log message is shown for each item being stored; to disable this, use the -q option.
By default, if an item is a directory, all files underneath it will be stored recursively; to disable this behavior, pass the -n option.
The log message must be given using the -m option.
Information about the commiter can be given using the -c option. This should be used with something like 'cron-autocommit', or 'pre-upgrade-autocommit', since cfvers is designed to also run in automated mode; here the uid/gid would be 0 always, so we wouldn't get useful information from there. By default, the commiter string is equal to the login name of the user.
This manual page was written by Iustin Pop <iusty@k1024.org>
The manual pages cvs(1) and svn(1) were used as sources of inspiration (and copy-paste in some cases), since these are real versioning programs :-), with proper man pages.