Source Code Control System
Jul. 21st, 2009 03:19 pmPOSIX specifies SCCS, Source Code Control System, the first version control system in the World. An article describing usage, internals, and history of it was written by its author, Marc Rochkind, and published in 1975. Inside an Open Group-certified system with XSI (development) extension, SCCS is highly integrated with the `make' program, providing a comfortable way to develop small programs locally.
In Debian, this revision control system is available in particular through a package called `cssc', and GNU Make in turn does know about SCCS' commands. Unfortunately, GNU Make does not support PROJECTDIR environment variable specified in the POSIX standard to provide a way to work with projects together with other local users in a given system. However, the latter feature is no more meaningful for the current state of the IT world, thanks to the Internet widely available.
In any way, SCCS in Debian can be an appropriate tool for tracking local projects, documents, or configuration files constantly being changed. Transparent and simple structure of the history files (so-called s-files) allows fixing small errors in tracked files without unnecessary increase of the version numbers. One of its features is labeling source code modules with identifiers recognizable by the `what' utility - it can be useful to determine the version for each module a given build is constructed from:
Currently, the `cssc' package makes available only the front-end command, `sccs', but POSIX specifies also `get', `what', `delta', etc. Since the `get' command is supposed to be present by GNU Make, it is worth fixing that, for instance, by providing a set of symbolic links to the corresponding executables in ~/bin directory. Later, a package called `posix-utils' is going to be proposed to Debian such a way that it would create them system-wide making the system closer to POSIX Shell and Utilities conformance.
In Debian, this revision control system is available in particular through a package called `cssc', and GNU Make in turn does know about SCCS' commands. Unfortunately, GNU Make does not support PROJECTDIR environment variable specified in the POSIX standard to provide a way to work with projects together with other local users in a given system. However, the latter feature is no more meaningful for the current state of the IT world, thanks to the Internet widely available.
In any way, SCCS in Debian can be an appropriate tool for tracking local projects, documents, or configuration files constantly being changed. Transparent and simple structure of the history files (so-called s-files) allows fixing small errors in tracked files without unnecessary increase of the version numbers. One of its features is labeling source code modules with identifiers recognizable by the `what' utility - it can be useful to determine the version for each module a given build is constructed from:
alexo@zoo:~$ ls
bin mbox src workspace
alexo@zoo:~$ cd src
alexo@zoo:~/src$ mkdir hello
alexo@zoo:~/src$ cd hello
alexo@zoo:~/src/hello$ mkdir SCCS
alexo@zoo:~/src/hello$ cat >hello.c
#include <stdio.h>
static const char version[] = "%W%";
main()
{
printf("hello\n");
return 0;
}
alexo@zoo:~/src/hello$ sccs create hello.c
hello.c:
1.1
9 lines
alexo@zoo:~/src/hello$ ls
,hello.c hello.c SCCS
alexo@zoo:~/src/hello$ cat hello.c
#include <stdio.h>
static const char version[] = "@(#)hello.c 1.1";
main()
{
printf("hello\n");
return 0;
}
alexo@zoo:~/src/hello$ rm ,hello.c
alexo@zoo:~/src/hello$ cat >Makefile
# %W%
all: hello
clean:
rm -f hello
alexo@zoo:~/src/hello$ sccs create Makefile
Makefile:
1.1
6 lines
alexo@zoo:~/src/hello$ ls
hello.c Makefile ,Makefile SCCS
alexo@zoo:~/src/hello$ cat Makefile
# @(#)Makefile 1.1
all: hello
clean:
rm -f hello
alexo@zoo:~/src/hello$ rm ,Makefile
alexo@zoo:~/src/hello$ sccs clean
alexo@zoo:~/src/hello$ ls
SCCS
alexo@zoo:~/src/hello$ make
get SCCS/s.Makefile
1.1
6 lines
get SCCS/s.hello.c
1.1
9 lines
cc -c -o hello.o hello.c
cc hello.o -o hello
rm hello.o hello.c
alexo@zoo:~/src/hello$ ls
hello Makefile SCCS
alexo@zoo:~/src/hello$ what hello
hello:
hello.c 1.1
alexo@zoo:~/src/hello$ ./hello
hello
alexo@zoo:~/src/hello$ sccs edit hello.c
1.1
new delta 1.2
9 lines
alexo@zoo:~/src/hello$ sed s/hello/bye/ hello.c >hello.c.tmp
alexo@zoo:~/src/hello$ mv hello.c.tmp hello.c
alexo@zoo:~/src/hello$ sccs delta hello.c
comments? Changed the "hello" line to "bye".
1.2
1 inserted
1 deleted
8 unchanged
alexo@zoo:~/src/hello$ ls
hello Makefile SCCS
alexo@zoo:~/src/hello$ make
get SCCS/s.hello.c
1.2
9 lines
cc -c -o hello.o hello.c
cc hello.o -o hello
rm hello.o hello.c
alexo@zoo:~/src/hello$ what hello
hello:
hello.c 1.2
alexo@zoo:~/src/hello$ ./hello
bye
alexo@zoo:~/src/hello$ Currently, the `cssc' package makes available only the front-end command, `sccs', but POSIX specifies also `get', `what', `delta', etc. Since the `get' command is supposed to be present by GNU Make, it is worth fixing that, for instance, by providing a set of symbolic links to the corresponding executables in ~/bin directory. Later, a package called `posix-utils' is going to be proposed to Debian such a way that it would create them system-wide making the system closer to POSIX Shell and Utilities conformance.