rcsmerge
Merge RCS file revisions
SYNOPSIS
rcsmerge [ options ] revision file
rcsmerge [ options ] revision1 revision2 file
PARAMETERS
-ksubst
Specify the keyword substitution format. Valid substitutions include kv (default), kvl, kvb, k, v, b.
-L
Lock the RCS file during the merge process. This prevents other users from modifying the RCS file concurrently.
-p
Send the merged result to standard output rather than overwriting the working file. This is useful for previewing merges or piping the output.
-q
Run in quiet mode. Suppress diagnostic messages and error reports that would normally be printed.
-rrevision
Use the specified revision as the common ancestor for the merge. This is crucial for controlling the base point of the three-way merge.
-T
Preserve the modification time of the RCS file. This can be important for build systems that rely on timestamps.
-Vn
Emulate RCS version n for compatibility reasons. This can be useful when working with older RCS files or systems.
-xsuffixes
Specify a comma-separated list of suffixes to recognize as RCS files. For example, .c,v or .h,v.
-zzone
Specify the time zone for timestamps. This affects how revision timestamps are interpreted and displayed.
DESCRIPTION
rcsmerge performs a three-way merge operation, combining changes from one or two RCS revisions into a working file. It is primarily used to integrate changes from a specific RCS revision (or a pair of revisions) into a local working copy. Typically, this involves comparing the current working file against a common ancestor and a target revision from an RCS file. When merging two revisions from an RCS file, rcsmerge computes the differences between the two specified revisions and applies those differences to the working file.
The command outputs the merged result to standard output by default, but can also directly overwrite the working file. If conflicts occur during the merge, rcsmerge inserts standard conflict markers (e.g., <<<<<<<, =======, >>>>>>>) into the output, indicating sections that require manual resolution. This utility is fundamental for managing parallel development and integrating divergent changes within the RCS version control system.
CAVEATS
- rcsmerge handles conflicts by inserting standard conflict markers into the output, requiring manual resolution by the user.
- It is a low-level utility within the RCS system, which itself has largely been superseded by more modern and feature-rich version control systems like Git or Subversion.
- It primarily operates on text files; merging binary files is not effectively supported and can lead to corrupt results.
- Requires the corresponding RCS file (e.g., file,v) to be present and accessible for the merge operation to succeed.
EXIT STATUS
The rcsmerge command exits with a status of 0 if the merge was successful and no conflicts were detected. It exits with 1 if conflicts were detected and marked in the output, indicating that manual resolution is required. A status greater than 1 typically indicates an error during execution.
HISTORY
rcsmerge is an integral part of the original Revision Control System (RCS), developed by Walter F. Tichy at Purdue University in the early 1980s. RCS was one of the earliest widely adopted version control systems, primarily focusing on managing individual files. rcsmerge emerged as a necessary component to resolve concurrent changes and integrate divergent branches, a fundamental requirement for collaborative software development.
While newer, more distributed, and feature-rich version control systems like Git and Subversion have largely replaced RCS for project-wide management, rcsmerge remains relevant in environments still utilizing RCS or when needing a robust, low-level three-way merge utility. Its underlying merge logic, often leveraging diff3, influenced subsequent merge tools.


