Revision Control

Several examples in this book have covered the topic of integrating mdoc documents into revision control systems. In this section, I cover the few steps required to integrate these documents with cvs.

Assume a file foo.in.1. consists of our mdoc source. I assume, for simplicity, that it is licensed with the ISC license and copyright-protected, both of which lead the document as a series of comments.

.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd August 18 2011
.Dt FOO 1
.Os

The first step is to add a useful message to the top of the file as the version of the file. This is standard practise in revision controlled files.

.\"    $​Id$
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>

Make sure that the first line has a tab character between the leading comment marker and $​Id$. This sequence is filled in with the file's last editor, revision, and checkin date.

Some cvs servers (e.g., those in NetBSD and OpenBSD) support the Mdocdate sequence. This is filled by in cvs with the check-in date.

.Dd $​Mdocdate$
.Dt FOO 1
.Os

In performing these two steps, the file's last-modified date and source identifier will be properly filled in by the cvs server. If your server does not support Mdocdate, you will have to maintain the date by hand, or possibly override the build rule for your file.

Last edited by $Author: kristaps $ on $Date: 2012/01/01 15:13:33 $. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.