CVS(1)
๐ CVS(1) ๐
okay bestie, so this is the manual page for cvs, aka the Concurrent Versions System, and it lives in the General Commands Manual section 1. Buckle up, it's a long one โ this is only part 1 of 12, so hydrate first ๐ซถ
โจ NAME โจ
cvs โ Concurrent Versions System
โจ SYNOPSIS โจ
cvs [ cvs_options ]
cvs_command [ command_options ] [ command_args ]
๐ NOTE ๐
heads up, this manual page is literally just a summary of parts of the cvs documentation, and it's automatically generated from an appendix of the CVS manual (aka the Cederqvist, iconic name, iykyk). That Cederqvist is also where all the cross-references in this page point, so if you want the full deep-dive on the Concurrent Versions System, go read the actual CVS manual, no cap.
If you're reading this manual page as part of the MirBSD online (HTML) manual pages archive, then follow the cvs(GNU) link to get to the Cederqvist โ and the cvsclient(GNU) link if you need the client/server protocol description.
If you installed cvs via the Debian or MirPorts Framework package management systems, these are the Cederqvist rendered as actual books, for printing and for reading on screen:
/usr/mpkg/share/doc/cvs/cvs.pdf(MirPorts Framework)/usr/share/doc/cvs/cvs.pdf(Debian)
If you have a Texinfo reader like info installed (it's part of the base system on MirBSD, and part of the info package on Debian), you can read the Cederqvist by typing:
info cvs
And here's a quick intro to info so you're not immediately lost, bestie:
- arrow keys โ to move on the page
- Tab โ to move to the next hyperlink
- Return โ to activate the hyperlink under the cursor
- l (lowercase ell) โ to go to the previously visited page
- Page Up/b, Page Down/Space โ to move by screen pages, including advancing to the previous (or next, respectively) section at the first (last) screen page
- p, n โ to go to the previous (next) page on the current navigation hierarchy level
- t โ to go to the
"Top"page, i.e. the start of the document - /<search-term>Return โ to start a search from the current cursor position and jump to the first result
- /Return โ to jump to the next result in an ongoing search
- q โ to exit the info viewer
Other ways to read further documentation are described in the SEE ALSO section of this manual page ๐
๐ CVS COMMANDS ๐
Guide to CVS commands
This appendix describes the overall structure of cvs commands, and describes some commands in detail. (Others are described elsewhere โ for a quick reference to cvs commands, see node 'Invoking CVS' in the CVS manual, and for an alphabetical list of all cvs commands, see node 'CVS command list' in the CVS manual.)
๐ฆ STRUCTURE ๐ฆ
Overall structure of CVS commands
The overall format of all cvs commands is:
cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
cvsโ the name of thecvsprogram.cvs_optionsโ some options that affect all sub-commands ofcvs. These are described below.cvs_commandโ one of several different sub-commands. Some of the commands have aliases that can be used instead; those aliases are noted in the reference manual for that command. There are only two situations where you may omitcvs_command:cvs -Helicits a list of available commands, andcvs -vdisplays version information oncvsitself.command_optionsโ options that are specific for the command.command_argsโ arguments to the commands.
unfortunately there's some confusion betweencvs_optionsandcommand_options. When given as acvs_option, some options only affect some of the commands. When given as acommand_optionit may have a different meaning, and be accepted by more commands. In other words, do not take the above categorization too seriously. Look at the documentation instead. ๐
๐ EXIT STATUS ๐
CVS's exit status
cvs can indicate to the calling environment whether it succeeded or failed by setting its exit status. The exact way of testing the exit status will vary from one operating system to another. For example, in a unix shell script the $? variable will be 0 if the last command returned a successful exit status, or greater than 0 if the exit status indicated failure.
If cvs is successful, it returns a successful status; if there is an error, it prints an error message and returns a failure status. The one exception to this is the cvs diff command. It will return a successful status if it found no differences, or a failure status if there were differences or if there was an error. Because this behavior provides no good way to detect errors, in the future it is possible that cvs diff will be changed to behave like the other cvs commands. ๐ญ
๐ ~/.cvsrc ๐
Default options and the ~/.cvsrc file
There are some command_options that get used so often that you might have set up an alias or some other means to make sure you always specify that option. One example (the one that literally drove the implementation of the .cvsrc support, actually) is that lots of people find the default output of the diff command very hard to read, and that either context diffs or unidiffs are much easier to understand.
The ~/.cvsrc file is a way that you can add default options to cvs_commands within cvs, instead of relying on aliases or other shell scripts.
The format of the ~/.cvsrc file is simple. The file is searched for a line that begins with the same name as the cvs_command being executed. If a match is found, then the remainder of the line is split up (at whitespace characters) into separate options and added to the command arguments before any options from the command line.
If a command has two names (e.g., checkout and co), the official name โ not necessarily the one used on the command line โ will be used to match against the file. So if this is the contents of the user's ~/.cvsrc file:
log -N
diff -uN
rdiff -u
update -Pd
checkout -P
release -d
then the command cvs checkout foo would have the -P option added to the arguments, as well as cvs co foo. slay, consistency ๐
With the example file above, the output from cvs diff foobar will be in unidiff format. cvs diff -c foobar will provide context diffs, as usual. Getting "old" format diffs would be slightly more complicated, because diff doesn't have an option to specify use of the "old" format, so you would need cvs -f diff foobar.
In place of the command name you can use cvs to specify global options (see node 'Global options' in the CVS manual). For example, the following line in .cvsrc
cvs -z6
causes cvs to use compression level 6. ๐ฅ
๐ Global options โจ
okay bestie so these are the cvs_options โ the little flags that go to the LEFT of your cvs_command. like, before the verb. yes order matters, no we don't make the rules ๐
here's the whole menu:
--allow-root=rootdirโ you can throw this one down multiple times, once per legalcvsrootdirectory you wanna bless. it also makes CVS preparse the configuration file for every root you name, which is lowkey handy when you're setting up write proxies. see node 'Password authentication server' in the CVS manual & node 'Write proxies' in the CVS manual. ๐ซถ-aโ authenticate ALL the communication between client and server. only does anything on the cvs client side, bestie. as of this writing it's only implemented when you're riding a GSSAPI connection (see node 'GSSAPI authenticated' in the CVS manual). what's the vibe? it stops certain sorts of attacks involving hijacking the active tcp connection. but real talk โ turning on authentication does NOT turn on encryption. two different things, don't confuse them. ๐ญ-b bindirโ back in the day, likecvs 1.9.18and older, this said "hey the rcs programs live in thebindirdirectory." current versions of cvs do not run rcs programs at all, so for compatibility this option is accepted, but it does nothing. it's giving ghost of cvs past ๐-T tempdirโ usetempdiras the directory where temporary files are located. the cvs client and server both stash temp files in a temporary directory, and the path to that directory gets set via โ in order of precedence:- the argument to the global
-Toption. - the value set for
TmpDirin the config file (server only โ see node 'config' in the CVS manual). - the contents of the
$TMPDIRenvironment variable (%TMPDIR%on Windows โ see node 'Environment variables' in the CVS manual). /tmp
- the argument to the global
temporary directories should always be specified as an absolute pathname, no shortcuts. and when you're running a CVS client, -T affects only the local process โ specifying -T for the client has no effect on the server and vice versa. they're not sharing, they're just neighbors ๐ฆ
-d cvs_root_directoryโ usecvs_root_directoryas the root directory pathname of the repository. this overrides whatever$CVSROOTwas set to. see node 'Repository' in the CVS manual. ๐-e editorโ useeditorto enter revision log information. overrides the setting of the$CVSEDITORand$EDITORenvironment variables. for more info, see node 'Committing your changes' in the CVS manual. โ๏ธ-fโ do NOT read the~/.cvsrcfile. this one gets used most often because of the non-orthogonality of the cvs option set (yes that's the real reason, iykyk). like, for example: the cvslogoption-N(turn off display of tag names) does not have a corresponding option to turn the display on. so if you have-Nin the~/.cvsrcentry forlog, you may need to use-fto show the tag names. trapped with no undo button, periodt ๐ญ-gโ forges group-writable permissions on files in the working copy. typically you'd reach for this when you have multiple users sharing a single checked out source tree, which lets them operate their shells with a less dangerousumaskโ at the expense of cvs security, so keep your eyes open. to use this feature: create a directory to hold the checked-out source tree, set it to a private group, and set up the directory such that files created under it inherit the gid of the directory. on BSD systems this occurs automatically. on SYSV systems and GNU/Linux, thesgidbit must be set on the directory for this. and the users who are to share the checked out tree must be placed in that group which owns the directory. ๐
note that the sharing of a single checked-out source tree is very different from giving several users access to a common cvs repository. access to a common cvs repository already maintains shared group-write permissions and does not require this option. don't mix them up bestie ๐
due to the security implications, setting this option globally in your.cvsrcfile is strongly discouraged; if you must, ensure all source checkouts are "firewalled" within a private group or a private mode0700directory. that's not a suggestion, that's a boundary ๐
this option is a MidnightBSD extension merged into Debian and MirBSD cvs. iconic crossover fr fr ๐
-H,--helpโ display usage information about the specifiedcvs_command(but do not actually execute the command). if you don't specify a command name,cvs -Hdisplays overall help for cvs, including a list of other help options. it's the "tell me everything but don't touch anything" option ๐-Rโ turns on read-only repository mode. this allows one to check out from a read-only repository, such as within an anoncvs server, or from a cd-rom repository. same effect as if theCVSREADONLYFSenvironment variable is set. bonus: using-Rcan also considerably speed up checkouts over NFS. speed AND safety, we love a multitasker โญ-nโ do not change any files. attempt to execute thecvs_command, but only to issue reports; do not remove, update, or merge any existing files, or create any new files. it's the dress rehearsal of commands ๐ง
note that cvs will not necessarily produce exactly the same output as without -n. in some cases the output will be the same, but in other cases cvs will skip some of the processing that would have been required to produce the exact same output. so don't treat it like a perfect mirror, okay?
-Qโ cause the command to be really quiet; the command will only generate output for serious problems. silence level: final boss ๐-qโ cause the command to be somewhat quiet; informational messages, such as reports of recursion through subdirectories, are suppressed. the chill middle ground ๐ฆ-rโ make new working files read-only. same effect as if the$CVSREADenvironment variable is set (see node 'Environment variables' in the CVS manual). the default is to make working files writable, unless watches are on (see node 'Watches' in the CVS manual). ๐-s variable=valueโ set a user variable (see node 'Variables' in the CVS manual). short and sweet ๐ธ-tโ trace program execution; display messages showing the steps of cvs activity. particularly useful with-nto explore the potential impact of an unfamiliar command. detective mode, we're investigating ๐-v,--versionโ display version and copyright information for cvs. โจ-wโ make new working files read-write. overrides the setting of the$CVSREADenvironment variable. files are created read-write by default, unless$CVSREADis set or-ris given. ๐-xโ encrypt all communication between the client and the server. only has an effect on the cvs client. as of this writing, this is only implemented when using a GSSAPI connection (see node 'GSSAPI authenticated' in the CVS manual) or a Kerberos connection (see node 'Kerberos authenticated' in the CVS manual). enabling encryption implies that message traffic is also authenticated. encryption support is not available by default โ it must be enabled using a special configure option,--enable-encryption, when you build cvs. so if it's not working, that's why bestie ๐ญ-z levelโ request compression level for network traffic. cvs interpretslevelidentically to thegzipprogram. valid levels are1(high speed, low compression) to9(low speed, high compression), or0to disable compression (the default). data sent to the server will be compressed at the requested level and the client will request the server use the same compression level for data returned. the server will use the closest level allowed by the server administrator to compress returned data. this option only has an effect when passed to the cvs client. ๐๏ธโจ
Common options
Common command options
Okay so these are the command_options that show up across a bunch of different cvs commands โ the โจsharedโจ ones. They always go to the right of cvs_command. Not every command supports every single one; each option only exists for the commands where it actually makes sense. But when a command does have one of these, you can pretty much count on it behaving the same way it does everywhere else. (Other command options โ the ones listed with the individual commands โ may act totally different from one cvs command to the next, so don't get it twisted.)
๐ Heads up: the history command is the exception. It supports a whole bunch of options that conflict even with these standard ones. It's giving chaos.
-D date_specโ Grab the most recent revision no later thandate_spec.date_specis a single argument, a date description pointing at a date in the past.
It's sticky, bestie! When you use it to make a private copy of a source file โ like when you get a working file using -D โ cvs records the date you specified, so any further updates in that same directory will use that same date. (More on sticky tags/dates in node 'Sticky tags' in the CVS manual.)
-D is available with the annotate, checkout, diff, export, history, ls, rdiff, rls, rtag, tag, and update commands. (Fair warning: the history command uses this option in a slightly different way โ see node 'history options' in the CVS manual.)
For a complete description of the date formats accepted by cvs, see node 'Date input formats' in the CVS manual.
๐ซถ And please quote your argument to the -D flag so your shell doesn't go feral and read the spaces as argument separators. A command using the -D flag can look like this:
$ cvs diff -D "1 hour ago" cvs.texinfo
-fโ So when you specify a particular date or tag tocvscommands, they normally ignore files that don't contain the tag you specified (or that didn't exist prior to the date you specified). Use-fif you want files retrieved anyway, even when there's no match for the tag or date. (The most recent revision of the file will be used.)
Note that even with -f, a tag you specify must exist โ like, in some file, not necessarily in every file. That's so cvs will keep giving you an error if you mistype a tag name. Periodt.
-f is available with these commands: annotate, checkout, export, rdiff, rtag, and update.
โ ๏ธ WARNING: Thecommitandremovecommands also have a-foption, but it has a different behavior for those commands. See node 'commit options' in the CVS manual, and node 'Removing files' in the CVS manual. Don't get caught slippin'. ๐ญ
-k kflagโ Override the default processing of RCS keywords other than-kb. See node 'Keyword substitution' in the CVS manual for the meaning ofkflag. ๐ Used with thecheckoutandupdatecommands, yourkflagspecification is sticky โ that is, when you use this option with acheckoutorupdatecommand,cvsassociates your selectedkflagwith any files it operates on, and keeps using thatkflagwith future commands on the same files until you specify otherwise.
The -k option is available with the add, checkout, diff, export, import, rdiff, and update commands.
โ ๏ธ WARNING: Prior to CVS version 1.12.2, the-kflag overrode the-kbindication for a binary file. This could sometimes corrupt binary files. ๐ See node 'Merging and keywords' in the CVS manual for more.
-lโ Local! Run only in the current working directory, rather than recursing through subdirectories. โจ
Available with the following commands: annotate, checkout, commit, diff, edit, editors, export, log, rdiff, remove, rtag, status, tag, unedit, update, watch, and watchers.
-m messageโ Usemessageas log information, instead of invoking an editor. ๐
Available with the following commands: add, commit and import.
-nโ Do not run any tag program. (A program can be specified to run in the modules database โ see node 'modules' in the CVS manual โ and this option bypasses it.)
Note: this is not the same as thecvs -nprogram option, which you can specify to the left of acvscommand! iykyk.
Available with the checkout, commit, export, and rtag commands.
-Pโ Prune empty directories. ๐งน See node 'Removing directories' in the CVS manual.-pโ Pipe the files retrieved from the repository to standard output, rather than writing them in the current directory. Available with thecheckoutandupdatecommands.-Rโ Process directories recursively. This is the default for allcvscommands, with the exception ofls&rls. ๐
Available with the following commands: annotate, checkout, commit, diff, edit, editors, export, ls, rdiff, remove, rls, rtag, status, tag, unedit, update, watch, and watchers.
-r tag,-r tag[:date]โ Use the revision specified by thetagargument (and thedateargument, for the commands which accept it) instead of the default head revision. On top of the arbitrary tags you define with thetagorrtagcommand, two special tags are always available:HEADrefers to the most recent version available in the repository (also known as the tip of theMAINbranch, also known as trunk; the name of a branch refers to its tip; this version ofcvsintroduces.bhead, but only for thediffcommand, for the same), andBASErefers to the revision you last checked out into the current working directory.
The tag specification is sticky when you use this with checkout or update to make your own copy of a file: cvs remembers the tag and continues to use it on future update commands, until you specify otherwise. (More on sticky tags/dates in node 'Sticky tags' in the CVS manual.)
The tag can be either a symbolic or numeric tag, as described in node 'Tags' in the CVS manual, or the name of a branch, as described in node 'Branching and merging' in the CVS manual. When tag is the name of a branch, some commands accept the optional date argument to specify the revision as of the given date on the branch. When a command expects a specific revision, the name of a branch is interpreted as the most recent revision on that branch. ๐ธ
As a Debian and MirBSD cvs extension, specifying BASE as the date portion of the argument yields the base revision of the branch specified by the tag portion of the argument โ i.e. the revision on the parent branch the tag branch split off from, or, where both branches were the same. ๐ฆ This option has not received very much testing, beware!
Specifying the -q global option along with the -r command option is often useful, to suppress the warning messages when the rcs file does not contain the specified tag.
Note: this is not the same as the overallcvs -roption, which you can specify to the left of acvscommand!
-r tag is available with the commit and history commands.
-r tag[:date] is available with the annotate, checkout, diff, export, rdiff, rtag, and update commands.
-Wโ Specify file names that should be filtered. ๐ง You can use this option repeatedly. The spec can be a file name pattern of the same type that you can specify in the.cvswrappersfile. Available with the following commands:import, andupdate.
admin, annotate, Date input formats, CVS commands
adminโAdministration front-end for RCS
- Requires: repository, working directory.
- Changes: repository.
- Synonym:
rcs
This is the cvs interface to assorted administrative facilities. Some of them have questionable usefulness for cvs but exist for historical purposes. Some of the questionable options are likely to disappear in the future. ๐ญ This command does work recursively, so extreme care should be used. Like, be careful bestie.
On unix, if there is a group named cvsadmin, only members of that group can run cvs admin commands, except for those specified using the UserAdminOptions configuration option in the CVSROOT/config file. Options specified using UserAdminOptions can be run by any user. See node 'config' in the CVS manual for more on UserAdminOptions.
The cvsadmin group should exist on the server, or any system running the non-client/server cvs. To disallow cvs admin for all users, create a group with no users in it. On NT, the cvsadmin feature does not exist and all users can run cvs admin.
admin options
Some of these options have questionable usefulness for cvs but exist for historical purposes. Some even make it impossible to use cvs until you undo the effect! ๐ Not me warning you twice.
-Aoldfileโ Might not work together withcvs. Append the access list ofoldfileto the access list of the rcs file.-aloginsโ Might not work together withcvs. Append the login names appearing in the comma-separated listloginsto the access list of the rcs file.-b[rev]โ Set the default branch torev. Incvs, you normally do not manipulate default branches; sticky tags (see node 'Sticky tags' in the CVS manual) are a better way to decide which branch you want to work on. There is one reason to runcvs admin -b: to revert to the vendor's version when using vendor branches (see node 'Reverting local changes' in the CVS manual). There can be no space between-band its argument.-cstringโ Sets the comment leader tostring. The comment leader is not used by current versions ofcvsorrcs5.7. Therefore, you can almost surely not worry about it. ๐ See node 'Keyword substitution' in the CVS manual.-e[logins]โ Might not work together withcvs. Erase the login names appearing in the comma-separated listloginsfrom the access list of the RCS file. Ifloginsis omitted, erase the entire access list. There can be no space between-eand its argument.-Iโ Run interactively, even if the standard input is not a terminal. This option does not work with the client/servercvsand is likely to disappear in a future release ofcvs.-iโ Useless withcvs. ๐ This creates and initialises a new rcs file, without depositing a revision. Withcvs, add files with thecvs addcommand (see node 'Adding files' in the CVS manual).-ksubstโ Set the default keyword substitution tosubst. See node 'Keyword substitution' in the CVS manual. Giving an explicit-koption tocvs update,cvs export, orcvs checkoutoverrides this default.-l[rev]โ Lock the revision with numberrev. If a branch is given, lock the latest revision on that branch. Ifrevis omitted, lock the latest revision on the default branch. There can be no space between-land its argument.
ok bestie so this is the part where -l keeps yapping ๐
This can be used in conjunction with the rcslock.pl script in the contrib directory of the cvs source distribution to provide reserved checkouts (where only one user can be editing a given file at a time). See the comments in that file for details (and see the README file in that directory for disclaimers about the unsupported nature of contrib). According to comments in that file, locking must set to strict (which is the default).
-Lโ set locking to strict. Strict locking means the owner of an RCS file is not exempt from locking for checkin. For use withcvs, strict locking must be set; see the discussion under the-loption above. ๐-mrev:msgโ replace the log message of revision rev with msg. ๐-Nname[:[rev]]โ act like-n, except it overrides any previous assignment of name. For use with magic branches, see node 'Magic branch numbers' in the CVS manual.-nname[:[rev]]โ associate the symbolic name with the branch or revision rev. ngl it's normally better to usecvs tagorcvs rtaginstead. Delete the symbolic name if both:and rev are omitted; otherwise, print an error message if name is already associated with another number. If rev is symbolic, it is expanded before association. A rev consisting of a branch number followed by a.stands for the current latest revision in the branch. A:with an empty rev stands for the current latest revision on the default branch, normally the trunk. For example,cvs admin -nname:associates name with the current latest revision of all the RCS files; this contrasts withcvs admin -nname:$which associates name with the revision numbers extracted from keyword strings in the corresponding working files. โจ-orangeโ deletes (outdates) the revisions given by range.
ok so REAL TALK: this command can be quite dangerous unless you know exactly what you are doing (for example see the warnings below about how the rev1:rev2 syntax is confusing). ๐
If you are short on disc this option might help you. But think twice before using itโthere is no way short of restoring the latest backup to undo this command! If you delete different revisions than you planned, either due to carelessness or (heaven forbid) a cvs bug, there is no opportunity to correct the error before the revisions are deleted. It probably would be a good idea to experiment on a copy of the repository first. ๐
Specify range in one of the following ways:
rev1::rev2โ collapse all revisions between rev1 and rev2, so thatcvsonly stores the differences associated with going from rev1 to rev2, not intermediate steps. For example, after-o 1.3::1.5one can retrieve revision1.3, revision1.5, or the differences to get from1.3to1.5, but not the revision1.4, or the differences between1.3and1.4. Other examples:-o 1.3::1.4and-o 1.3::1.3have no effect, because there are no intermediate revisions to remove.::revโ collapse revisions between the beginning of the branch containing rev and rev itself. The branchpoint and rev are left intact. For example,-o ::1.3.2.6deletes revision1.3.2.1, revision1.3.2.5, and everything in between, but leaves1.3and1.3.2.6intact.rev::โ collapse revisions between rev and the end of the branch containing rev. Revision rev is left intact but the head revision is deleted.revโ delete the revision rev. For example,-o 1.3is equivalent to-o 1.2::1.4.rev1:rev2โ delete the revisions from rev1 to rev2, inclusive, on the same branch. One will not be able to retrieve rev1 or rev2 or any of the revisions in between. For example, the commandcvs admin -oR_1_01:R_1_02 .is rarely useful. It means to delete revisions up to, and including, the tagR_1_02. But beware! If there are files that have not changed betweenR_1_02andR_1_03the file will have the same numerical revision number assigned to the tagsR_1_02andR_1_03. So not only will it be impossible to retrieveR_1_02;R_1_03will also have to be restored from the tapes! In most cases you want to specifyrev1::rev2instead. ๐ญ:revโ delete revisions from the beginning of the branch containing rev up to and including rev.rev:โ delete revisions from revision rev, including rev itself, to the end of the branch containing rev.
None of the revisions to be deleted may have branches or locks.
If any of the revisions to be deleted have symbolic names, and one specifies one of the :: syntaxes, then cvs will give an error and not delete any revisions. If you really want to delete both the symbolic names and the revisions, first delete the symbolic names with cvs tag -d, then run cvs admin -o. If one specifies the non-:: syntaxes, then cvs will delete the revisions but leave the symbolic names pointing to nonexistent revisions. This behavior is preserved for compatibility with previous versions of cvs, but because it isn't very useful, in the future it may change to be like the :: case. ๐ฆ
Due to the way cvs handles branches rev cannot be specified symbolically if it is a branch. See node 'Magic branch numbers' in the CVS manual, for an explanation.
Make sure that no-one has checked out a copy of the revision you outdate. Strange things will happen if he starts to edit it and tries to check it back in. For this reason, this option is not a good way to take back a bogus commit; commit a new revision undoing the bogus change instead (see node 'Merging two revisions' in the CVS manual). fr fr, do NOT do this ๐จ
-qโ run quietly; do not print diagnostics. ๐คซ-sstate[:rev]โ useful withcvs. Set the state attribute of the revision rev to state. If rev is a branch number, assume the latest revision on that branch. If rev is omitted, assume the latest revision on the default branch. Any identifier is acceptable for state. A useful set of states isExp(for experimental),Stab(for stable), andRel(for released). By default, the state of a new revision is set toExpwhen it is created. The state is visible in the output fromcvs log(see node 'log' in the CVS manual), and in the$Log$and$State$keywords (see node 'Keyword substitution' in the CVS manual). Note thatcvsuses thedeadstate for its own purposes (see node 'Attic' in the CVS manual); to take a file to or from thedeadstate use commands likecvs removeandcvs add(see node 'Adding and removing' in the CVS manual), notcvs admin -s. ๐-t[file]โ useful withcvs. Write descriptive text from the contents of the named file into the RCS file, deleting the existing text. The file pathname may not begin with-. The descriptive text can be seen in the output fromcvs log(see node 'log' in the CVS manual). There can be no space between-tand its argument. ๐
If file is omitted, obtain the text from standard input, terminated by end-of-file or by a line containing . by itself. Prompt for the text if interaction is possible; see -I.
-t-stringโ similar to-tfile. Write descriptive text from the string into the rcs file, deleting the existing text. There can be no space between-tand its argument.-Uโ set locking to non-strict. Non-strict locking means that the owner of a file need not lock a revision for checkin. For use withcvs, strict locking must be set; see the discussion under the-loption above.-u[rev]โ see the option-labove, for a discussion of using this option withcvs. Unlock the revision with number rev. If a branch is given, unlock the latest revision on that branch. If rev is omitted, remove the latest lock held by the caller. Normally, only the locker of a revision may unlock it; somebody else unlocking a revision breaks the lock. This causes the original locker to be sent a commit notification (see node 'Getting Notified' in the CVS manual). There can be no space between-uand its argument. ๐-Vnโ in previous versions ofcvs, this option meant to write an rcs file which would be acceptable to rcs version n, but it is now obsolete and specifying it will produce an error. ๐-xsuffixesโ in previous versions ofcvs, this was documented as a way of specifying the names of the rcs files. However,cvshas always required that the rcs files used bycvsend in,v, so this option has never done anything useful. ๐ธ
annotate, checkout, admin, CVS commands
๐ annotate ๐
โจ annotateโWhat revision modified each line of a file? โจ
- Synopsis:
annotate [options] files...
rannotate [options] files...
- Requires: repository.
- Changes: nothing.
For each file in files, print the head revision of the trunk, together with information on the last modification for each line. If backwards annotation is requested, show the first modification after the specified revision. (Backwards annotation currently appears to be broken.) ๐ญ
๐ annotate options ๐
These standard options are supported by annotate (see node 'Common options' in the CVS manual, for a complete description of them):
-bโ backwards, show when a line was removed. Currently appears to be broken. ๐-lโ local directory only, no recursion.-Rโ process directories recursively.-fโ use head revision if tag/date not found.-Fโ annotate binary files.-r tag[:date]โ annotate file as of specified revision/tag or, when date is specified and tag is a branch tag, the version from the branch tag as it existed on date. See node 'Common options' in the CVS manual.-D dateโ annotate file as of specified date.
๐ฆ annotate example ๐ฆ
For example:
$ cvs annotate ssfile
Annotations for ssfile
***************
1.1 (mary 27-Mar-96): ssfile line 1
1.2 (joe 28-Mar-96): ssfile line 2
The file ssfile currently contains two lines. The ssfile line 1 line was checked in by mary on March 27. Then, on March 28, joe added a line ssfile line 2, without modifying the ssfile line 1 line. This report doesn't tell you anything about lines which have been deleted or replaced; you need to use cvs diff for that (see node 'diff' in the CVS manual). ๐ฅ
The options to cvs annotate are listed in node 'Invoking CVS' in the CVS manual, and can be used to select the files and revisions to annotate. The options are described in more detail there and in node 'Common options' in the CVS manual. ๐
๐๏ธ checkout โ Check out sources for editing
- Synopsis:
checkout [options] modules... - Requires: repository. ๐
- Changes: working directory.
- Synonyms:
co,get
okay bestie so checkout is literally THE move that creates or updates a working directory full of copies of the source files you named in modules. ๐ And no cap โ you have to run checkout before you can use most of the other cvs commands, because most of them operate on your working directory. It's giving prerequisites, fr fr.
So what even are the modules? They're either symbolic names for some collection of source directories and files, or straight-up paths to directories or files in the repository. The symbolic names get defined in the modules file. Peep node 'modules' in the CVS manual. โจ
Depending on which modules you ask for, checkout may recursively create directories and fill them with the appropriate source files. After that you can edit those files whenever you want (and yes, it does not matter if other software developers are editing their own copies of the sources at the same time, live your life ๐
); you can update them to pull in new changes other people applied to the source repository; or you can commit your work as a permanent change to the source repository. iconic behavior honestly.
Not me needing to tell you this: checkout is used to create directories. The top-level directory created is always added to the directory where checkout was invoked, and it usually has the same name as the module you specified. If it's a module alias, the created sub-directory may have a different name โ but you can be sure it will be a sub-directory, and that checkout will show the relative path leading to each file as it gets extracted into your private work area (unless you specify the -Q global option). ๐ฆ
The files created by checkout are created read-write, unless:
- the
-roption tocvsis specified (see node 'Global options' in the CVS manual), - the
CVSREADenvironment variable is specified (see node 'Environment variables' in the CVS manual), or - a watch is in effect for that file (see node 'Watches' in the CVS manual).
Also, running checkout on a directory that was already built by a prior checkout is totally permitted, bestie. It's similar to specifying the -d option to the update command, in the sense that new directories that have been created in the repository will show up in your work area. The difference: checkout takes a module name whereas update takes a directory name.
๐จ IMPORTANT: to usecheckoutthis way it must be run from the top level directory (where you originally rancheckoutfrom). So before you runcheckoutto update an existing directory, don't forget to change your directory to the top level directory. Not me forgetting this every single time ๐ญ
For the output produced by the checkout command, see node 'update output' in the CVS manual.
โจ checkout options โจ
These standard options are supported by checkout (see node 'Common options' in the CVS manual for a complete description of them):
-D dateโ use the most recent revision no later than date. This option is sticky, and implies-P. See node 'Sticky tags' in the CVS manual for more info on sticky tags/dates.-fโ only useful with the-Dor-rflags. If no matching revision is found, retrieve the most recent revision (instead of ignoring the file).-k kflagโ process keywords according to kflag. See node 'Keyword substitution' in the CVS manual. This option is sticky; future updates of this file in this working directory will use the same kflag. Thestatuscommand can be viewed to see the sticky options. See node 'Invoking CVS' in the CVS manual for more information on thestatuscommand.-lโ local; run only in current working directory.-nโ do not run any checkout program (as specified with the-ooption in the modules file; see node 'modules' in the CVS manual).-Pโ prune empty directories. See node 'Moving directories' in the CVS manual.-pโ pipe files to the standard output.-Rโ checkout directories recursively. This option is on by default.-r tag[:date]โ checkout the revision specified by tag or, when date is specified and tag is a branch tag, the version from the branch tag as it existed on date. This option is sticky, and implies-P. See node 'Sticky tags' in the CVS manual for more info on sticky tags/dates. Also, see node 'Common options' in the CVS manual.
In addition to those, you can use these special command options with checkout:
-Aโ reset any sticky tags, dates, or-koptions. See node 'Sticky tags' in the CVS manual for more info on sticky tags/dates.-cโ copy the module file, sorted, to the standard output, instead of creating or modifying any files or directories in your working directory.-d dirโ create a directory called dir for the working files, instead of using the module name. In general, using this flag is equivalent to usingmkdir dir; cd dirfollowed by thecheckoutcommand without the-dflag.
There is an important exception, however. It is very convenient when checking out a single item to have the output appear in a directory that doesn't contain empty intermediate directories. In this case only, cvs tries to "shorten" pathnames to avoid those empty directories. ๐
For example, given a module foo that contains the file bar.c, the command cvs co -d dir foo will create directory dir and place bar.c inside. Similarly, given a module bar which has subdirectory baz wherein there is a file quux.c, the command cvs co -d dir bar/baz will create directory dir and place quux.c inside.
Using the -N flag will defeat this behavior. Given the same module definitions above, cvs co -N -d dir foo will create directories dir/foo and place bar.c inside, while cvs co -N -d dir bar/baz will create directories dir/bar/baz and place quux.c inside.
-j tagโ with two-joptions, merge changes from the revision specified with the first-joption to the revision specified with the secondjoption, into the working directory.
With one -j option, merge changes from the ancestor revision to the revision specified with the -j option, into the working directory. The ancestor revision is the common ancestor of the revision which the working directory is based on, and the revision specified in the -j option.
In addition, each -j option can contain an optional date specification which, when used with branches, can limit the chosen revision to one within a specific date. An optional date is specified by adding a colon (:) to the tag: -jSymbolic_Tag:Date_Specifier.
See node 'Branching and merging' in the CVS manual.
-Nโ only useful together with-d dir. With this option,cvswill not "shorten" module paths in your working directory when you check out a single module. See the-dflag for examples and a discussion.-sโ like-c, but include the status of all modules, and sort it by the status string. See node 'modules' in the CVS manual for info about the-soption that is used inside the modules file to set the module status.
๐ธ checkout examples ๐ธ
Get a copy of the module tc:
$ cvs checkout tc
Get a copy of the module tc as it looked one day ago:
$ cvs checkout -D yesterday tc
๐พ commit โ Check files into the repository
- Synopsis:
commit [-lnRf] [-m 'log_message' | -F file] [-r revision] [files...] - Requires: working directory, repository.
- Changes: repository.
- Synonym:
ci
Use commit when you want to incorporate changes from your working source files into the source repository. This is the "make it official" button, bestie. ๐ซถ
If you don't specify particular files to commit, all of the files in your working current directory are examined. commit is careful to change in the repository only those files that you have really changed. By default (or if you explicitly specify the -R option), files in subdirectories are also examined and committed if they have changed; you can use the -l option to limit commit to the current directory only.
commit verifies that the selected files are up to date with the current revisions in the source repository; it will notify you, and exit without committing, if any of the specified files must be made current first with update (see node 'update' in the CVS manual). And no, commit does not call the update command for you โ it rather leaves that for you to do when the time is right. ๐
When all is well, an editor is invoked to allow you to enter a log message that will be written to one or more logging programs (see node 'modules' in the CVS manual, and see node 'loginfo' in the CVS manual) and placed in the rcs file inside the repository. This log message can be retrieved with the log command; see node 'log' in the CVS manual. You can specify the log message on the command line with the -m message option, and thus avoid the editor invocation, or use the -F file option to specify that the argument file contains the log message.
At commit, a unique commitid is placed in the rcs file inside the repository. All files committed at once get the same commitid, a string consisting only of hexadecimal digits (usually 16 in GNU cvs, 19 in Debian and MirBSD cvs). FSF GNU cvs 1.11 and OpenBSD OpenCVS do not support commitids yet. The commitid can be retrieved with the log and status command; see node 'log' in the CVS manual and node 'File status' in the CVS manual. ๐ง
๐ commit options ๐
okay bestie, so commit is serving these standard options (peep node 'Common options' in the CVS manual for the full tea, fr fr):
-lโ Local; run only in current working directory. it's giving "just this folder" energy. ๐-Rโ Commit directories recursively. this is on by default, no cap. โจ-rrevision โ Commit to revision. revision must be either a branch, or a revision on the main trunk that is higher than any existing revision number (see node 'Assigning revisions' in the CVS manual). You cannot commit to a specific revision on a branch. bestie, that's just the rules. ๐ญ
and commit also supports these options:
-cโ Refuse to commit files unless the user has registered a valid edit on the file viacvs edit. This is most useful whencommit -candedit -chave been placed in all.cvsrcfiles. A commit can be forced anyways by either registering an edit retroactively viacvs edit(no changes to the file will be lost) or using the-foption to commit. Support forcommit -crequires both client and a server versions1.12.10or greater. ๐-Ffile โ Read the log message from file, instead of invoking an editor. ๐-fโ Note that this is not the standard behavior of the-foption as defined in node 'Common options' in the CVS manual. Force cvs to commit a new revision even if you haven't made any changes to the file. As of cvs version1.12.10, it also causes the-coption to be ignored. If the current revision of file is1.7, then the following two commands are equivalent:
$ cvs commit -f file
$ cvs commit -r 1.8 file
The -f option disables recursion (i.e., it implies -l). To force cvs to commit a new revision for all files in all subdirectories, you must use -f -R. ๐
-mmessage โ Use message as the log message, instead of invoking an editor. ๐ฌ
๐ธ commit examples ๐ธ
๐ Committing to a branch ๐
You can commit to a branch revision (one that has an even number of dots) with the -r option. To create a branch revision, use the -b option of the rtag or tag commands (see node 'Branching and merging' in the CVS manual). Then, either checkout or update can be used to base your sources on the newly created branch. From that point on, all commit changes made within these working sources will be automatically added to a branch revision, thereby not disturbing main-line development in any way. For example, if you had to create a patch to the 1.2 version of the product, even though the 2.0 version is already under development, you might do:
$ cvs rtag -b -r FCS1_2 FCS1_2_Patch product_module
$ cvs checkout -r FCS1_2_Patch product_module
$ cd product_module
[[ hack away ]]
$ cvs commit
This works automatically since the -r option is sticky. iconic behavior, periodt. โจ
๐ฆ Creating the branch after editing ๐ฆ
Say you have been working on some extremely experimental software, based on whatever revision you happened to checkout last week. If others in your group would like to work on this software with you, but without disturbing main-line development, you could commit your change to a new branch. Others can then checkout your experimental stuff and utilise the full benefit of cvs conflict resolution. The scenario might look like:
[[ hacked sources are present ]]
$ cvs tag -b EXPR1
$ cvs update -r EXPR1
$ cvs commit
The update command will make the -r EXPR1 option sticky on all files. Note that your changes to the files will never be removed by the update command. The commit will automatically commit to the correct branch, because the -r is sticky. You could also do like this:
[[ hacked sources are present ]]
$ cvs tag -b EXPR1
$ cvs commit -r EXPR1
but then, only those files that were changed by you will have the -r EXPR1 sticky flag. If you hack away, and commit without specifying the -r EXPR1 flag, some files may accidentally end up on the main trunk. not the vibe, bestie. ๐ญ
To work with you on the experimental change, others would simply do:
$ cvs checkout -r EXPR1 whatever_module
๐ diff, export, commit, CVS commands ๐
๐ diffโShow differences between revisions ๐
- Synopsis:
diff [-lR] [-k kflag] [format_options] [(-r rev1[:date1] | -D date1) [-r rev2[:date2] | -D date2]] [files...] - Requires: working directory, repository.
- Changes: nothing.
The diff command is used to compare different revisions of files. The default action is to compare your working files with the revisions they were based on, and report any differences that are found.
If any file names are given, only those files are compared. If any directories are given, all files under them will be compared.
The exit status for diff is different than for other cvs commands; for details see node 'Exit status' in the CVS manual. ๐
โจ diff options โจ
bestie, these standard options are all supported by diff (go peep node 'Common options' in the CVS manual if you want the full rundown of them):
-D dateโ use the most recent revision that's no later than date. Wanna know how this messes with the comparison? Scroll to-r, it explains the whole thing.-k kflagโ process keywords according to kflag. See node 'Keyword substitution' in the CVS manual.-lโ local vibes only; run just in the current working directory.-Rโ examine directories recursively. This one is on by default, so it's already slaying without you asking.-r tag[:date]โ compare with the revision specified by tag, or, when date is specified and tag is a branch tag, the version from the branch tag as it existed on date. You can have zero, one or two-roptions, and here's the tea:- with no
-roption, your working file gets compared with the revision it was based on. - with one
-r, that revision gets compared to your current working file. - with two
-roptions, those two revisions get compared to each other (and your working file does not affect the outcome in any way, periodt).
- with no
One or both -r options can be swapped out for a -D date option, described above.
okay so now for the part that controls what your output actually looks like. The following options specify the format of the output. They have the same meaning as in GNU diff. Most options have two equivalent names, one of which is a single letter preceded by -, and the other of which is a long name preceded by --.
-linesโ show lines (an integer) lines of context. Heads up though: this option does not specify an output format by itself, so it literally does nothing unless you combine it with-cor-u. Also it's obsolete, soโฆ yeah. For proper operation,patchtypically needs at least two lines of context.-aโ treat all files as text and compare them line-by-line, even if they do not seem to be text. no judgement here ๐-bโ ignore trailing white space, and consider all other sequences of one or more white space characters to be equivalent.-Bโ ignore changes that just insert or delete blank lines.--binaryโ read and write data in binary mode.--briefโ report only whether the files differ, not the details of the differences.-cโ use the context output format.-C lines,--context[=lines]โ use the context output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation,patchtypically needs at least two lines of context.--changed-group-format=formatโ use format to output a line group containing differing lines from both files in if-then-else format. See node 'Line group formats' in the CVS manual.-dโ change the algorithm to perhaps find a smaller set of changes. This makesdiffslower (sometimes much slower). trade-off queen ๐ญ-e,--edโ make output that is a validedscript.--expand-tabsโ expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.-fโ make output that looks vaguely like anedscript but has changes in the order they appear in the file.-F regexpโ in context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.--forward-edโ make output that looks vaguely like anedscript but has changes in the order they appear in the file.-Hโ use heuristics to speed handling of large files that have numerous scattered small changes.--horizon-lines=linesโ do not discard the last lines lines of the common prefix and the first lines lines of the common suffix.-iโ ignore changes in case; consider upper- and lower-case letters equivalent.-I regexpโ ignore changes that just insert or delete lines that match regexp.--ifdef=nameโ make merged if-then-else output using name.--ignore-all-spaceโ ignore white space when comparing lines.--ignore-blank-linesโ ignore changes that just insert or delete blank lines.--ignore-caseโ ignore changes in case; consider upper- and lower-case to be the same.--ignore-matching-lines=regexpโ ignore changes that just insert or delete lines that match regexp.--ignore-space-changeโ ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent.--initial-tabโ output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.-L labelโ use label instead of the file name in the context format and unified format headers.--label=labelโ use label instead of the file name in the context format and unified format headers.--left-columnโ print only the left column of two common lines in side by side format.--line-format=formatโ use format to output all input lines in if-then-else format. See node 'Line formats' in the CVS manual.--minimalโ change the algorithm to perhaps find a smaller set of changes. This makesdiffslower (sometimes much slower).-nโ output RCS-format diffs; like-fexcept that each command specifies the number of lines affected.-N,--new-fileโ in directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.--new-group-format=formatโ use format to output a group of lines taken from just the second file in if-then-else format. See node 'Line group formats' in the CVS manual.--new-line-format=formatโ use format to output a line taken from just the second file in if-then-else format. See node 'Line formats' in the CVS manual.--old-group-format=formatโ use format to output a group of lines taken from just the first file in if-then-else format. See node 'Line group formats' in the CVS manual.--old-line-format=formatโ use format to output a line taken from just the first file in if-then-else format. See node 'Line formats' in the CVS manual.-pโ show which C function each change is in.--rcsโ output RCS-format diffs; like-fexcept that each command specifies the number of lines affected.--report-identical-files,-sโ report when two files are the same.--show-c-functionโ show which C function each change is in.--show-function-line=regexpโ in context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.--side-by-sideโ use the side by side output format.--speed-large-filesโ use heuristics to speed handling of large files that have numerous scattered small changes.--suppress-common-linesโ do not print common lines in side by side format.-tโ expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.-Tโ output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.--textโ treat all files as text and compare them line-by-line, even if they do not appear to be text.-uโ use the unified output format.--unchanged-group-format=formatโ use format to output a group of common lines taken from both files in if-then-else format. See node 'Line group formats' in the CVS manual.--unchanged-line-format=formatโ use format to output a line common to both files in if-then-else format. See node 'Line formats' in the CVS manual.-U lines,--unified[=lines]โ use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation,patchtypically needs at least two lines of context.-wโ ignore white space when comparing lines.-W columns,--width=columnsโ use an output width of columns in side by side format.-yโ use the side by side output format.
๐ Line group formats ๐
okay bestie so line group formats are literally the glow-up you apply to a whole group of similar lines at once โ they're designed for all those apps that take if-then-else style input, like programming languages and text-formatting languages. A line group format tells CVS how to print out one contiguous group of similar lines. iconic. โจ
So for example, this command compares the TeX file myfile with the original version from the repository, and spits out a merged file where old regions are wrapped in \begin{em}-\end{em} lines and new regions get wrapped in \begin{bf}-\end{bf} lines. ๐
cvs diff \
--old-group-format='\begin{em}
%<\end{em}
' \
--new-group-format='\begin{bf}
%>\end{bf}
' \
myfile
And this next one? Same thing, lowkey, it's equivalent to the example above โ it's just a little more verbose because it spells out the default line group formats. ๐ซถ
cvs diff \
--old-group-format='\begin{em}
%<\end{em}
' \
--new-group-format='\begin{bf}
%>\end{bf}
' \
--unchanged-group-format='%=' \
--changed-group-format='\begin{em}
%<\end{em}
\begin{bf}
%>\end{bf}
' \
myfile
Now HERE's the advanced one, which outputs a diff listing with headers containing line numbers in a ``plain English'' style. she's giving โจscholarโจ:
cvs diff \
--unchanged-group-format='' \
--old-group-format='-------- %dn line%(n=1?:s) deleted at %df:
%<' \
--new-group-format='-------- %dN line%(N=1?:s) added after %de:
%>' \
--changed-group-format='-------- %dn line%(n=1?:s) changed at %df:
%<-------- to:
%>' \
myfile
To specify a line group format, you use one of the options listed below, bestie. You can specify up to four line group formats โ one for each kind of line group. And you should quote format, because it typically contains shell metacharacters. do not skip that part fr fr. ๐
--old-group-format=formatโ these line groups are hunks containing only lines from the first file. The default old group format is the same as the changed group format if it's specified; otherwise it's a format that outputs the line group as-is.--new-group-format=formatโ these line groups are hunks containing only lines from the second file. The default new group format is same as the changed group format if it's specified; otherwise it's a format that outputs the line group as-is.--changed-group-format=formatโ these line groups are hunks containing lines from both files. The default changed group format is the concatenation of the old and new group formats.--unchanged-group-format=formatโ these line groups contain lines common to both files. The default unchanged group format is a format that outputs the line group as-is.
Inside a line group format, ordinary characters represent themselves, and conversion specifications start with % and take one of the following forms. ๐
%<โ stands for the lines from the first file, including the trailing newline. Each line is formatted according to the old line format (see node 'Line formats' in the CVS manual).%>โ stands for the lines from the second file, including the trailing newline. Each line is formatted according to the new line format.%=โ stands for the lines common to both files, including the trailing newline. Each line is formatted according to the unchanged line format.%%โ stands for%.%c'C'โ where C is a single character, stands for C. C may not be a backslash or an apostrophe. For example,%c':'stands for a colon, even inside the then-part of an if-then-else format, which a colon would normally terminate.%c'\O'โ where O is a string of 1, 2, or 3 octal digits, stands for the character with octal code O. For example,%c'\0'stands for a null character.Fnโ where F is aprintfconversion specification and n is one of the following letters, stands for n's value formatted with F.eโ the line number of the line just before the group in the old file.fโ the line number of the first line in the group in the old file; equalse + 1.lโ the line number of the last line in the group in the old file.mโ the line number of the line just after the group in the old file; equalsl + 1.nโ the number of lines in the group in the old file; equalsl - f + 1.E,F,L,M,Nโ likewise, for lines in the new file.
The printf conversion specification can be %d, %o, %x, or %X, specifying decimal, octal, lower case hexadecimal, or upper case hexadecimal output respectively. After the % the following options can appear in sequence: a - specifying left-justification; an integer specifying the minimum field width; and a period followed by an optional integer specifying the minimum number of digits. For example, %5dN prints the number of new lines in the group in a field of width 5 characters, using the printf format "%5d".
(A=B?T:E)โ if A equals B then T else E. A and B are each either a decimal constant or a single letter interpreted as above. This format spec is equivalent to T if A's value equals B's; otherwise it is equivalent to E.
For example, %(N=0?no:%dN) line%(N=1?:s) is equivalent to no lines if N (the number of lines in the group in the new file) is 0, to 1 line if N is 1, and to %dN lines otherwise.
๐ธ Line formats ๐ธ
Line formats control how each line taken from an input file gets output as part of a line group in if-then-else format. tiny but mighty. ๐
So for example, this command outputs text with a one-column change indicator to the left of the text. The first column of output is - for deleted lines, | for added lines, and a space for unchanged lines. The formats contain newline characters where newlines are desired on output. ๐ฆ
cvs diff \
--old-line-format='-%l
' \
--new-line-format='|%l
' \
--unchanged-line-format=' %l
' \
myfile
To specify a line format, use one of the following options. You should quote format, since it often contains shell metacharacters. no cap. ๐
--old-line-format=formatโ formats lines just from the first file.--new-line-format=formatโ formats lines just from the second file.--unchanged-line-format=formatโ formats lines common to both files.--line-format=formatโ formats all lines; in effect, it sets all three above options simultaneously.
Inside a line format, ordinary characters represent themselves, and conversion specifications start with % and take one of the following forms. โญ
%lโ stands for the contents of the line, not counting its trailing newline (if any). This format ignores whether the line is incomplete.%Lโ stands for the contents of the line, including its trailing newline (if any). If a line is incomplete, this format preserves its incompleteness.%%โ stands for%.%c'C'โ where C is a single character, stands for C. C may not be a backslash or an apostrophe. For example,%c':'stands for a colon.%c'\O'โ where O is a string of 1, 2, or 3 octal digits, stands for the character with octal code O. For example,%c'\0'stands for a null character.Fnโ where F is aprintfconversion specification, stands for the line number formatted with F. For example,%.5dnprints the line number using theprintfformat"%.5d". See node 'Line group formats' in the CVS manual, for more aboutprintfconversion specifications.
The default line format is %l followed by a newline character.
okay heads up bestie: if the input contains tab characters and it is important that they line up on output, you should ensure that%lor%Lin a line format is just after a tab stop (e.g. by preceding%lor%Lwith a tab character), or you should use the-tor--expand-tabsoption. ๐
Taken together, the line and line group formats let you specify many different formats. For example, the following command uses a format similar to diff's normal format. You can tailor this command to get fine control over diff's output. ๐
cvs diff \
--old-line-format='< %l
' \
--new-line-format='> %l
' \
--old-group-format='%df%(f=l?:,%dl)d%dE
%<' \
--new-group-format='%dea%dF%(F=L?:,%dL)
%>' \
--changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)
%<โ
%>' \
--unchanged-group-format='' \
myfile
๐ diff examples ๐
The following line produces a Unidiff (-u flag) between revision 1.14 and 1.19 of backend.c. Due to the -kk flag no keywords are substituted, so differences that only depend on keyword substitution are ignored. ๐ฅ
$ cvs diff -kk -u -r 1.14 -r 1.19 backend.c
Suppose the experimental branch EXPR1 was based on a set of files tagged RELEASE_1_0. To see what has happened on that branch, the following can be used:
$ cvs diff -r RELEASE_1_0 -r EXPR1
A command like this can be used to produce a context diff between two releases:
$ cvs diff -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs
If you are maintaining ChangeLogs, a command like the following just before you commit your changes may help you write the ChangeLog entry. All local modifications that have not yet been committed will be printed. ๐
$ cvs diff -u | less
๐ฆ export, history, diff, CVS commands ๐ฆ
โจ exportโExport sources from CVS, similar to checkout โจ
- Synopsis:
export [-flNnR] (-r rev[:date] | -D date) [-k subst] [-d dir] module... - Requires: repository.
- Changes: current directory.
This command is a variant of checkout; use it when you want a copy of the source for module without the cvs administrative directories. Like, for example, you might use export to prepare source for shipment off-site. ๐ This command requires that you specify a date or tag (with -D or -r), so that you can count on reproducing the source you ship to others (and thus it always prunes empty directories). no cap, that's the whole point.
One often would like to use -kv with cvs export. This causes any keywords to be expanded such that an import done at some other site will not lose the keyword revision information. But be aware that doesn't handle an export containing binary files correctly. ๐ญ Also be aware that after having used -kv, one can no longer use the ident command (which is part of the rcs suiteโsee ident(1)) which looks for keyword strings. If you want to be able to use ident you must not use -kv.
โจ export options โจ
bestie, export rolls with these standard options (full tea in node 'Common options' in the CVS manual):
-D dateโ grab the most recent revision that's no later than date.-fโ if there's no matching revision, just take the most recent one instead of ghosting the file.-lโ local mode, it only runs in the current working directory.-nโ do not run any checkout program.-Rโ export directories recursively. this one is on by default, so like, it's the vibe already.-r tag[:date]โ export the revision named by tag, or, when date is given and tag is a branch tag, the version from the branch tag as it existed on date. see node 'Common options' in the CVS manual.
and ALSO, these ones (shared between checkout and export) are supported too:
-d dirโ make a directory called dir for the working files instead of using the module name. see node 'checkout options' in the CVS manual for the full deets on howcvshandles this flag.-k substโ set the keyword expansion mode (see node 'Substitution modes' in the CVS manual).-Nโ only useful together with-d dir. see node 'checkout options' in the CVS manual for the complete details on howcvshandles this flag.
history, import, export, CVS commands
๐ธ historyโShow repository access history ๐ธ
- Synopsis:
history [-report] [-flags] [-options args] [files...] - Requires: the file
$CVSROOT/CVSROOT/history - Changes: nothing.
cvs can keep a history log that tracks every single time you use most cvs commands. and then history lets you display all that info in a bunch of different formats. it's giving receipts ๐
to turn logging on, the LogHistory config option has to be set to something that isn't the empty string, and the history file named by the HistoryLogPath option has to be writable by every user who might run the cvs executable (see node 'config' in the CVS manual).
to turn the history command itself on, logging must be enabled like above and the HistorySearchPath config option (see node 'config' in the CVS manual) has to be set to specify some number of the history logs created that way, and those files have to be readable by every user who might run the history command.
creating a repository with the cvs init command will enable logging of all possible events to a single history log file ($CVSROOT/CVSROOT/history) with read and write permissions for all users (see node 'Creating a repository' in the CVS manual).
โ ๏ธ Note:historyuses-f,-l,-n, and-pin ways that conflict with the normal use insidecvs(see node 'Common options' in the CVS manual). do not get it twisted.
โจ history options โจ
several options (shown above as -report) control what kind of report gets generated:
-cโ report on each timecommitwas used (i.e., each time the repository was modified).-eโ everything (all record types). equivalent to specifying-xwith all record types. and of course-ewill also include record types that get added in a future version ofcvs; if you're writing a script that can only handle certain record types, you'll want to specify-xinstead.-m moduleโ report on a particular module. (you can meaningfully use-mmore than once on the command line.)-oโ report on checked-out modules. this is the default report type.-Tโ report on all tags.-x typeโ extract a particular set of record types type from thecvshistory. the types are indicated by single letters, and you can specify them in combination.
certain commands have a single record type:
Fโ releaseOโ checkoutEโ exportTโ rtag
one of five record types may result from an update:
Cโ a merge was necessary but collisions were detected (requiring manual merging).Gโ a merge was necessary and it succeeded.Uโ a working file was copied from the repository.Pโ a working file was patched to match the repository.Wโ the working copy of a file was deleted duringupdate(because it was gone from the repository).
one of three record types results from commit:
Aโ a file was added for the first time.Mโ a file was modified.Rโ a file was removed.
the options shown as -flags constrain or expand the report without needing option arguments:
-aโ show data for all users (the default is to show data only for the user executinghistory).-lโ show last modification only.-wโ show only the records for modifications done from the same working directory wherehistoryis executing.
the options shown as -options args constrain the report based on an argument:
-b strโ show data back to a record containing the string str in either the module name, the file name, or the repository path.-D dateโ show data since date. this is slightly different from the normal use of-D date, which selects the newest revision older than date.-f fileโ show data for a particular file (you can specify several-foptions on the same command line). this is equivalent to specifying the file on the command line.-n moduleโ show data for a particular module (you can specify several-noptions on the same command line).-p repositoryโ show data for a particular source repository (you can specify several-poptions on the same command line).-r revโ show records referring to revisions since the revision or tag named rev appears in individual rcs files. each rcs file is searched for the revision or tag.-t tagโ show records since tag tag was last added to the history file. this differs from the-rflag above in that it reads only the history file, not the rcs files, and is much faster.-u nameโ show records for user name.-z timezoneโ show times in the selected records using the specified time zone instead of UTC.
import, log, history, CVS commands
๐ฆ importโImport sources into CVS, using vendor branches ๐ฆ
- Synopsis:
import [-options] repository vendortag releasetag... - Requires: Repository, source distribution directory.
- Changes: repository.
use import to fold an entire source distribution from an outside source (like, say, a source vendor) into your source repository directory. you can use this command both for the initial creation of a repository and for wholesale updates to the module from the outside source. see node 'Tracking sources' in the CVS manual for a whole discussion on this subject.
the repository argument gives a directory name (or a path to a directory) under the cvs root directory for repositories; if the directory didn't exist, import creates it. main character energy fr.
when you use import for updates to source that's been modified in your source repository (since a prior import), it will notify you of any files that conflict in the two branches of development; use checkout -j to reconcile the differences, exactly like import tells you to do.
if cvs decides a file should be ignored (see node 'cvsignore' in the CVS manual), it does not import it and prints I followed by the filename (see node 'import output' in the CVS manual for a complete description of the output).
if the file $CVSROOT/CVSROOT/cvswrappers exists, any file whose names match the specifications in that file will be treated as packages, and the appropriate filtering will be performed on the file/directory before being imported. see node 'Wrappers' in the CVS manual.
the outside source is saved in a first-level branch, by default 1.1.1. updates are leaves of this branch; for example, files from the first imported collection of source will be revision 1.1.1.1, then files from the first imported update will be revision 1.1.1.2, and so on.
at least three arguments are required. repository is needed to identify the collection of source. vendortag is a tag for the entire branch (e.g., for 1.1.1). you must also specify at least one releasetag to uniquely identify the files at the leaves created each time you execute import. the releasetag should be new, not previously existing in the repository file, and uniquely identify the imported release,
note that import does not change the directory in which you invoke it. in particular, it does not set up that directory as a cvs working directory; if you want to work with the sources, import them first and then check them out into a different directory (see node 'Getting the source' in the CVS manual).
๐ import options ๐
this standard option is supported by import (see node 'Common options' in the CVS manual for a complete description):
-m messageโ use message as log information, instead of invoking an editor.
there are the following additional special options:
-b branchโ see node 'Multiple vendor branches' in the CVS manual.-k substโ indicate the keyword expansion mode desired. this setting will apply to all files created during the import, but not to any files that previously existed in the repository. see node 'Substitution modes' in the CVS manual for a list of valid-ksettings.-I nameโ specify file names that should be ignored during import. you can use this option repeatedly. to avoid ignoring any files at all (even those ignored by default), specify-I !.
name can be a file name pattern of the same type that you can specify in the .cvsignore file. see node 'cvsignore' in the CVS manual.
-W specโ specify file names that should be filtered during import. you can use this option repeatedly.
spec can be a file name pattern of the same type that you can specify in the .cvswrappers file. see node 'Wrappers' in the CVS manual.
-Xโ modify the algorithm used bycvswhen importing new files so that new files do not immediately appear on the main trunk.
specifically, this flag causes cvs to mark new files as if they were deleted on the main trunk, by taking the following steps for each file in addition to those normally taken on import: creating a new revision on the main trunk indicating that the new file is dead, resetting the new file's default branch, and placing the file in the Attic (see node 'Attic' in the CVS manual) directory.
setting the ImportNewFilesToVendorBranchOnly option in CVSROOT/config (see node 'config' in the CVS manual) forces use of this option on a repository-wide basis.
โจ import output โจ
okay so import is a chatty queen and she keeps you informed of her progress by printing one line per file, and each line starts with a single character that tells you the status of that file:
Ufile โ the file already exists in the repository and hasn't been modified locally, so a new revision has been created (if it needed to be). ๐Nfile โ it's a brand new file that just got added to the repository. slay.Cfile โ the file already exists in the repository but it's also been modified locally, so bestie... you're gonna have to merge the changes. ๐ญIfile โ this file is being ignored (see nodecvsignorein the CVS manual).Lfile โ it's a symbolic link, andcvs importignores symbolic links. People keep periodically suggesting this behavior should be changed, but if there's a consensus on what it should be changed to, it is not apparent. (Various options in themodulesfile can be used to recreate symbolic links oncheckout,update, etc.; see nodemodulesin the CVS manual.)
โจ import examples โจ
See node Tracking sources in the CVS manual, and node From files in the CVS manual.
๐ log, ls & rls, import, CVS commands
๐ฆ logโPrint out history information for files
- Synopsis:
log [options] [files...]
rlog [options] [files...]
- Requires: repository, working directory.
- Changes: nothing.
Display log information for files. log used to call the rcs utility rlog. That's not true in the current sources anymore, but this whole history is exactly why the output format and the options look... not quite like the style of the other cvs commands. iykyk. ๐
The output includes the location of the rcs file, the head revision (the latest revision on the trunk), all symbolic names (tags) and some other things. For each revision, the revision number, the date, the author, the number of lines added/deleted, the commitid and the log message get printed. All dates are displayed in local time at the client. This is typically specified in the $TZ environment variable, which you can set to govern how log displays dates. ๐
Note:loguses-Rin a way that conflicts with the normal use insidecvs(see nodeCommon optionsin the CVS manual).
๐ log options ๐
By default, log prints all information that is available. All other options restrict the output. Just so you know: the revision selection options (-d, -r, -s, and -w) have no effect โ other than possibly causing a search for files in Attic directories โ when they're used in conjunction with the options that restrict the output to only log header fields (-b, -h, -R, and -t), unless the -S option is also specified. ๐ซถ
-bโ print information about the revisions on the default branch, normally the highest branch on the trunk.-ddates โ print information about revisions with a checkin date/time in the range given by the semicolon-separated list of dates. The date formats accepted are those accepted by the-Doption to many othercvscommands (see nodeCommon optionsin the CVS manual). Dates can be combined into ranges like this:d1<d2d2>d1
Select the revisions that were deposited between d1 and d2.
<dd>
Select all revisions dated d or earlier.
d<>d
Select all revisions dated d or later.
d
Select the single, latest revision dated d or earlier.
The > or < characters may be followed by = to indicate an inclusive range rather than an exclusive one.
Note that the separator is a semicolon (;). don't forget her ๐
-hโ print only the name of the rcs file, name of the file in the working directory, head, default branch, access list, locks, symbolic names, and suffix.-lโ local; run only in current working directory. (Default is to run recursively).-Nโ do not print the list of tags for this file. This option can be very useful when your site uses a lot of tags, so rather thanmore'ing over 3 pages of tag information, the log information is presented without tags at all. obsessed.-Rโ print only the name of the rcs file.-rrevisionsโ print information about revisions given in the comma-separated list revisions of revisions and ranges. The following table explains the available range formats:rev1:rev2
Revisions rev1 to rev2 (which must be on the same branch).
rev1::rev2
The same, but excluding rev1.
:rev::rev
Revisions from the beginning of the branch up to and including rev.
rev:
Revisions starting with rev to the end of the branch containing rev.
rev::
Revisions starting just after rev to the end of the branch containing rev.
- branch
An argument that is a branch means all revisions on that branch.
branch1:branch2branch1::branch2
A range of branches means all revisions on the branches in that range.
branch.
The latest revision in branch.
A bare -r with no revisions means the latest revision on the default branch, normally the trunk. There can be no space between the -r option and its argument. no space, bestie, not even one โจ
-Sโ suppress the header if no revisions are selected.-sstates โ print information about revisions whose state attributes match one of the states given in the comma-separated list states. Individual states may be any text string, thoughcvscommonly only uses two states,Expanddead. See nodeadmin optionsin the CVS manual for more information.-tโ print the same as-h, plus the descriptive text.-wloginsโ print information about revisions checked in by users with login names appearing in the comma-separated list logins. If logins is omitted, the user's login is assumed. There can be no space between the-woption and its argument.
log prints the intersection of the revisions selected with the options -d, -s, and -w, intersected with the union of the revisions selected by -b and -r.
๐ log examples ๐
Since log shows dates in local time, you might want to see them in Coordinated Universal Time (UTC) or some other timezone. To do this you can set your $TZ environment variable before invoking cvs:
$ TZ=UTC cvs log foo.c
$ TZ=EST cvs log bar.c
(If you are using a csh-style shell, like tcsh, you would need to prefix the examples above with env.)
๐ ls & rls ๐
List files in the repository
- Synopsis:
ls [-e | -l] [-RP] [-r tag[:date]] [-D date] [path...]
rls [-e | -l] [-RP] [-r tag[:date]] [-D date] [path...]
- Requires: repository for
rls, repository & working directory forls. - Changes: nothing.
- Synonym:
dir&listare synonyms forlsandrdir&rlistare synonyms forrls.
The ls and rls commands are used to list files and directories in the repository.
By default ls lists the files and directories that belong in your working directory, what would be there after an update.
By default rls lists the files and directories on the tip of the trunk in the topmost directory of the repository.
Both commands accept an optional list of file and directory names, relative to the working directory for ls and the topmost directory of the repository for rls. Neither is recursive by default.
๐ฆ ls & rls options ๐ฆ
These standard options are supported by ls & rls:
-dโ show dead revisions (with tag when specified).-eโ display inCVS/Entriesformat. This format is meant to remain easily parsable by automation. ๐ค-lโ display all details.-Pโ don't list contents of empty directories when recursing.-Rโ list recursively.-rtag[:date] โ show files specified by tag or, when date is specified and tag is a branch tag, the version from the branch tag as it existed on date. See nodeCommon optionsin the CVS manual.-Ddate โ show files from date.
๐ธ rls examples ๐ธ
$ cvs rls
cvs rls: Listing module: `.'
CVSROOT
first-dir
$ cvs rls CVSROOT
cvs rls: Listing module: `CVSROOT'
checkoutlist
commitinfo
config
cvswrappers
loginfo
modules
notify
rcsinfo
taginfo
verifymsg
๐ฆ rdiff, release, ls & rls, CVS commands
rdiffโCreate patch format diffs between revisions
- Synopsis:
rdiff [-flags] [-V vn] (-r tag1[:date1] | -D date1) [-r tag2[:date2] | -D date2] modules...
- Requires: repository.
- Changes: nothing.
- Synonym:
patch
Builds a Larry Wall format patch(1) file between two releases, that can be fed directly into the patch program to bring an old release up-to-date with the new release. (This is one of the few cvs commands that operates directly from the repository, and doesn't require a prior checkout.) The diff output is sent to the standard output device. ๐ซฐ
You can specify (using the standard -r and -D options) any combination of one or two revisions or dates. If only one revision or date is specified, the patch file reflects differences between that revision or date and the current head revisions in the rcs file.
Note that if the software release affected is contained in more than one directory, then it may be necessary to specify the -p option to the patch command when patching the old sources, so that patch is able to find the files that are located in other directories. lowkey important, don't skip it ๐
-D dateโ grab the most recent revision that's no later than date. bestie, the newest one that still respects the cutoff ๐-fโ if nothing matches, just take the most recent revision anyway (instead of ghosting the file entirely).-k kflagโ process keywords the way kflag says. peepsee node 'Keyword substitution' in the CVS manualfor the full tea.-lโ local only, ok? do NOT descend into subdirectories.-Rโ walk directories recursively. this one's already on by default, so it's giving "reminder" energy โจ-r tagโ use the revision that tag points to, or if date is also given and tag is a branch tag, the version from that branch tag as it existed on date.see node 'Common options' in the CVS manualfor more.
on top of all that, these ones are also on the menu:
-cโ use the context diff format. and yes, that's the default, so it's the main character here ๐-pโ show which C function each change lives in.-sโ instead of a patch, make a summary change report. it's got the deets on files that got changed or added between the releases, and it goes to standard output. lowkey perfect for figuring out which files changed between two dates or revisions ๐ฆ-tโ a diff of the top two revisions, straight to standard output. this is chef's kiss for seeing what the last change to a file was.-uโ use the unidiff format for the context diffs. โ ๏ธ real talk: old versions of thepatchprogram literally can't handle unidiff, so if you're planning to post this patch to the net you should probably not use-u. consider yourself warned ๐-V vnโ expand keywords according to the rules current in rcs version vn (the expansion format changed with rcs version 5). ๐จ heads up though: this option is no longer accepted.cvswill always expand keywords the way that rcs version 5 does. periodt.
โจ rdiff examples โจ
okay imagine: you get mail from foo@example.net asking for an update from release 1.2 to 1.4 of the tc compiler. you have zero such patches on hand, but with cvs that's so easily fixed with a command like this:
$ cvs rdiff -c -r FOO1_2 -r FOO1_4 tc | \
$$ Mail -s 'The patches you asked for' foo@example.net
now suppose you made release 1.3 and forked a branch called R_1_3fix for bug fixes. R_1_3_1 corresponds to release 1.3.1, which was made some time ago. and now you wanna see how much development has happened on the branch. this command is the one:
$ cvs patch -s -r R_1_3_1 -r R_1_3fix module-name
cvs rdiff: Diffing module-name
File ChangeLog,v changed from revision 1.52.2.5 to 1.52.2.6
File foo.c,v changed from revision 1.52.2.3 to 1.52.2.4
File bar.h,v changed from revision 1.29.2.1 to 1.2
๐ธ release, server & pserver, rdiff, CVS commands ๐ธ
๐ releaseโIndicate that a directory is no longer in use ๐
release [-d] directories...- Requires: Working directory.
- Changes: Working directory, history log.
so this command is basically the polite way to undo the effect of cvs checkout. and here's the thing โ since cvs doesn't lock files, using it isn't strictly necessary. you can always just straight up delete your working directory if that's your vibe. BUT ๐ you risk losing changes you forgot about, and you leave zero trace in the cvs history file (see node 'history file' in the CVS manual) that you ever abandoned your checkout. ghosting your checkout with no receipts, basically.
use cvs release to dodge all that drama. it checks three things:
- that no uncommitted changes are present;
- that you're running it from immediately above a cvs working directory;
- that the repository recorded for your files matches the repository defined in the module database.
if all of those are true, cvs release leaves a record of its execution (attesting to your intentional abandoning of your checkout) in the cvs history log. iconic, accountable behavior ๐ซถ
๐ release options ๐
the release command supports exactly one command option:
-dโ delete your working copy of the file if the release succeeds. if you don't pass this flag, your files will remain in your working directory.
โ ๏ธ WARNING: thereleasecommand deletes all directories and files recursively. this has the very serious side-effect that any directory you created inside your checked-out sources and did not add to the repository (using theaddcommand;see node 'Adding files' in the CVS manual) will be silently deleted โ even if it is non-empty! like, gone gone. no cap. ๐ญ
๐ฆ release output ๐ฆ
before release releases your sources, it'll print a one-line message for any file that is not up-to-date.
U fileP file
there's a newer revision of this file in the repository, and you haven't modified your local copy (yes, U and P mean the same thing here โ twins fr fr).
A file
the file's been added to your private copy of the sources but hasn't been committed to the repository yet. if you delete your copy of the sources, this file will be lost. bestie protect it ๐
R file
the file's been removed from your private copy of the sources but hasn't been removed from the repository yet, since you haven't committed the removal. see node 'commit' in the CVS manual.
M file
the file is modified in your working directory. there might also be a newer revision inside the repository.
? file
file is in your working directory but doesn't correspond to anything in the source repository, and it's not on the list of files for cvs to ignore (see the description of the -I option, and see node 'cvsignore' in the CVS manual). if you remove your working sources, this file will be lost.
โญ release examples โญ
release the tc directory, and delete your local working copy of the files:
$ cd .. # You must stand immediately above the
# sources when you issue cvs release.
$ cvs release -d tc
You have [0] altered files in this repository.
Are you sure you want to release (and delete) directory `tc': y
$
๐ server & pserver ๐
๐ Act as a server for a client on stdin/stdout ๐
pserver [-c path]server [-c path]- Requires: repository, client conversation on stdin/stdout
- Changes: Repository or, indirectly, client working directory.
the cvs server and pserver commands are how you give remote clients access to a repository, and they expect a client conversation on stdin & stdout. typically these commands get launched from inetd or via ssh (see node 'Remote repositories' in the CVS manual).
server expects that the client has already been authenticated somehow โ typically via ssh โ while pserver attempts to authenticate the client itself. different energies, same goal โจ
only one option is available with the server and pserver commands:
-c pathโ load configuration from the given path rather than from the default location$CVSROOT/CVSROOT/config(see node 'config' in the CVS manual). path must be/etc/cvs.confor prefixed by/etc/cvs/. this option is supported beginning with cvs release 1.12.13.
๐ง suck, update, server & pserver, CVS commands ๐ง
๐ suckโDownload RCS ,v file raw ๐
suck module/pa/th- Requires: repository
locates the file module/pa/th,v or module/pa/Attic/th,v and downloads it raw as an RCS comma-v file. no filter, no chill.
the output is the real pathname of the comma-v file, relative to the CVS repository, followed by a newline and then the binary file content immediately after. it's giving "here's the whole thing, unedited" ๐
๐ update, , suck, CVS commands ๐
๐ updateโBring work tree in sync with repository ๐
update [-ACdflPpR] [-I name] [-j rev [-j rev]] [-k kflag] [-r tag[:date] | -D date] [-W spec] files...- Requires: repository, working directory.
- Changes: working directory.
so after you've run checkout to make your private copy of the source from the common repository, other developers keep on changing the central source. rude but okay. from time to time, whenever it's convenient in your development process, you can run the update command from inside your working directory to reconcile your work with any revisions applied to the source repository since your last checkout or update.
and here's the important bit: without the -C option, update will also merge any differences between the local copy of files and their base revisions into any destination revisions specified with -r, -D, or -A. so yeah, that's a whole merge happening. know what you're asking for, bestie ๐ซถ
update options ๐
These standard options are available with update (see node 'Common options' in the CVS manual, for a complete description of them):
-Ddate โ grab the most recent revision no later than date. Heads up bestie, this one is sticky, and it implies-P. See node 'Sticky tags' in the CVS manual, for more information on sticky tags/dates.-fโ only useful with the-Dor-rflags. If no matching revision is found, retrieve the most recent revision (instead of ignoring the file). โจ-kkflag โ process keywords according to kflag. See node 'Keyword substitution' in the CVS manual. This option is sticky; future updates of this file in this working directory will use the same kflag. Thestatuscommand can be viewed to see the sticky options. See node 'Invoking CVS' in the CVS manual, for more information on thestatuscommand.-lโ local; run only in current working directory. See node 'Recursive behavior' in the CVS manual.-Pโ prune empty directories. See node 'Moving directories' in the CVS manual.-pโ pipe files to the standard output.-Rโ update directories recursively (default). See node 'Recursive behavior' in the CVS manual.-rtag[:date] โ retrieve the revisions specified by tag or, when date is specified and tag is a branch tag, the version from the branch tag as it existed on date. This option is sticky, and it implies-P. See node 'Sticky tags' in the CVS manual, for more information on sticky tags/dates. Also see node 'Common options' in the CVS manual.
These special options are also available with update.
-Aโ reset any sticky tags, dates, or-koptions. See node 'Sticky tags' in the CVS manual, for more information on sticky tags/dates. ๐-Cโ overwrite locally modified files with clean copies from the repository (the modified file is saved in.#file.revision, however). Not the vibe you want on accident, bestie.-dโ create any directories that exist in the repository if they're missing from the working directory. Normally,updateacts only on directories and files that were already enrolled in your working directory.
This is useful for updating directories that were created in the repository since the initial checkout; but it has an unfortunate side effect. If you deliberately avoided certain directories in the repository when you created your working directory (either through use of a module name or by listing explicitly the files and directories you wanted on the command line), then updating with -d will create those directories, which may not be what you want. ๐ญ
-Iname โ ignore files whose names match name (in your working directory) during the update. You can specify-Imore than once on the command line to specify several files to ignore. Use-I !to avoid ignoring any files at all. See node 'cvsignore' in the CVS manual, for other ways to makecvsignore some files.-Wspecโ specify file names that should be filtered duringupdate. You can use this option repeatedly.
spec can be a file name pattern of the same type that you can specify in the .cvswrappers file. See node 'Wrappers' in the CVS manual.
-jrevisionโ with two-joptions, merge changes from the revision specified with the first-joption to the revision specified with the secondjoption, into the working directory.
With one -j option, merge changes from the ancestor revision to the revision specified with the -j option, into the working directory. The ancestor revision is the common ancestor of the revision which the working directory is based on, and the revision specified in the -j option.
Note that using a single -j tagname option rather than -j branchname to merge changes from a branch will often not remove files which were removed on the branch. See node 'Merging adds and removals' in the CVS manual, for more.
In addition, each -j option can contain an optional date specification which, when used with branches, can limit the chosen revision to one within a specific date. An optional date is specified by adding a colon (:) to the tag: -jSymbolic_Tag:Date_Specifier.
See node 'Branching and merging' in the CVS manual.
update output ๐ฆ
update and checkout keep you informed of their progress by printing a line for each file, preceded by one character indicating the status of the file:
Ufile โ the file was brought up to date with respect to the repository. This is done for any file that exists in the repository but not in your working directory, and for files that you haven't changed but are not the most recent versions available in the repository. ๐Pfile โ likeU, but thecvsserver sends a patch instead of an entire file. This accomplishes the same thing asUusing less bandwidth. Queen behaviour honestly.Afile โ the file has been added to your private copy of the sources, and will be added to the source repository when you runcommiton the file. This is a reminder to you that the file needs to be committed. ๐Rfile โ the file has been removed from your private copy of the sources, and will be removed from the source repository when you runcommiton the file. This is a reminder to you that the file needs to be committed.Mfile โ the file is modified in your working directory.
M can indicate one of two states for a file you're working on: either there were no modifications to the same file in the repository, so that your file remains as you last saw it; or there were modifications in the repository as well as in your copy, but they were merged successfully, without conflict, in your working directory.
cvs will print some messages if it merges your work, and a backup copy of your working file (as it looked before you ran update) will be made. The exact name of that file is printed while update runs.
Cfile โ a conflict was detected while trying to merge your changes to file with changes from the source repository. file (the copy in your working directory) is now the result of attempting to merge the two revisions; an unmodified copy of your file is also in your working directory, with the name.#file.revisionwhere revision is the revision that your modified file started from. Resolve the conflict as described in node 'Conflicts example' in the CVS manual. (Note that some systems automatically purge files that begin with.#if they have not been accessed for a few days. If you intend to keep a copy of your original file, it is a very good idea to rename it.) Undervms, the file name starts with__rather than.#.
๐จ Conflict energy!! Do not just vibe past a C, bestie, go read the node and fix it fr fr.
?file โ file is in your working directory, but does not correspond to anything in the source repository, and is not in the list of files forcvsto ignore (see the description of the-Ioption, and see node 'cvsignore' in the CVS manual).
โจ AUTHORS โจ
- Dick Grune โ Original author of the
cvsshell script version posted tocomp.sources.unixin thevolume6release of December, 1986. Credited with much of thecvsconflict resolution algorithms. ๐ - Brian Berliner โ Coder and designer of the
cvsprogram itself in April, 1989, based on the original work done by Dick. - Jeff Polk โ Helped Brian with the design of the
cvsmodule and vendor branch support and author of thecheckin(1)shell script (the ancestor ofcvs import). - Larry Jones, Derek R. Price, and Mark D. Baushke โ Have helped maintain
cvsfor many years. - And many others too numerous to mention here. ๐ซถ
๐ SEE ALSO ๐
The most comprehensive manual for CVS is Version Management with CVS by Per Cederqvist et al. (see NOTE at top).
For CVS updates, more information on documentation, software related to CVS, development of CVS, and more, see:
http://www.nongnu.org/cvs/
ci(1), co(1), cvs(5), cvsbug(8), diff(1), grep(1), patch(1), rcs(1),
rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), re_format(7).
And that's a wrap on the whole page, bestie!! ๐โจ You just read the entire CVS(1) manual page, section 1 of the manual, from the source/version header all the way down to that little CVS(1) footer at the bottom. Not me getting emotional over a version control system from the 80s ๐ญ Go commit something iconic. Periodt. ๐
๐ฆ
๐ฆ where this page comes from
- debian bookworm: cvs 2:1.12.13+real-28+deb12u1
- debian trixie: cvs 2:1.12.13+real-30
- ubuntu jammy: cvs 2:1.12.13+real-28
- ubuntu noble: cvs 2:1.12.13+real-30build1
- Copyright 2004-2005 The Free Software Foundation, Inc
- Copyright (c) 2004, 2010, 2012, 2016 mirabilos <m@mirbsd.org>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms