Copyright (C) 2000-2012 |
GNU Info (cvsbook.info)Controlling Keyword ExpansionControlling Keyword Expansion ----------------------------- By default, CVS performs keyword expansion unless you tell it to stop. You can permanently suppress keyword expansion for a file with the -k option when you add the file to the project, or you can turn it off later by invoking admin with -k. The -k option offers several different modes of keyword control; usually you want mode o or b, for example: floss$ cvs add -ko chapter-9.sgml This command added `chapter-9.sgml' to the project with keyword expansion turned off. It sets the file's default keyword expansion mode to `o', which means no substitution. (Actually, the "o" stands for "old", meaning to substitute the string with its old value, which is the same as substituting it for itself, resulting in no change. I'm sure this logic made sense to somebody at the time.) Each file's default keyword mode is stored in the repository. However, each working copy can also have its own local keyword substitution mode - accomplished with the -k options to checkout or update. You can also have a mode in effect for the duration of just one command, with the -k option to diff. Here are all the possible modes, presented with the -k option prepended (as one would type at a command line). Any of these options can be used as either the default or local keyword substitution mode for a file: * -kkv - Expands to keyword and value. This is the default keyword expansion mode, so you don't need to set it for new files. You might use it to change a file from another keyword mode, however. * -kkvl - Like -kkv, but includes the locker's name if the revision is currently locked. (See the -l option to admin for more on this.) * -kk - Won't expand values in keyword strings, just uses the keyword name. For example, with this option, $Revision: 1.5 $ and $Revision$ would both "expand" (okay, contract) to: $Revision$ * -ko - Reuses the keyword string found in the file (hence "o" for "old"), as it was in the working file just before the commit. * -kb - Like -ko, but also suppresses interplatform line-end conversions. The "b" stands for "binary"; it is the mode you should use for binary files. * -kv - Substitutes the keyword with its value, for example $Revision$ might become: 1.5 Of course, after that's happened once, future substitutions will not take place, so this option should be used with care. automatically generated by info2www version 1.2.2.9 |