9fans archive / 2001 / 11 / 759 /    prev next

From: geoff@col...
Subject: Re: [9fans] Python filesystem
Date: Thu, 29 Nov 2001 15:07:42 -0800

C News has the shell script that locks the news system and augments
PATH.  INN tends more to the monolithic end of the program-design
spectrum.

Version numbers in file names have some well known problems.  They
actually come from systems older than VMS, including at least
RS(u)X-11 and Tenex/TOPS-20, which takes us back about 30 years.  All
the implementations I've seen use a semi-colon to separate the real
file name from the version number.  Among other warts, this means you
have to quote them when referring to them from pretty much any shell:

	rm 'foo.c;1'
or
	rm 'foo.c;'*

In addition, the parsing of these names has traditionally been weird.
For example, foo.c means foo.c;0 (or foo.c;-1, I can't recall) which
means the most recent version of foo.c, perhaps foo.c;6.  I think the
other one (;-1 vs.  ;0) means the oldest version of foo.c still on
disk, perhaps foo.c;5.  Rob's and pjw's ``The Hideous Name'' paper
elaborates on these and other naming botches.

The reality is that you end up with a directory full of dreck rather
quickly, then the nightly PURGE command runs and clobbers all but the
most recent two or three versions (it's settable by your local
administrator and can be as low as one, if memory serves), so you
don't end up with a full history on disk, which is just as well
because you wouldn't be able to find anything.  Version numbers of
related files are not kept in synch, so you can't just

	cp *';6' /tmp/compile

to get a consistent snapshot.  File server dumps get this right:

; cd /n/dump/2001/1127/sys/src/cmd/disk/rkfs
; lc
all.h       dat.c       errno.h     ialloc.c    mkfile      sub.c
auth.c      dat.h       fcall.c     iobuf.c     portdat.h   uid.c
chk.c       dentry.c    fcallconv.c lib.h       portfns.h   utime.c
con.c       devmulti.c  fns.h       main.c      porttime.c
console.c   devwren.c   fs.c        misc.c      print.c
; mkdir /tmp/compile
; bind -bc /tmp/compile .
; mk
8c -FVw fs.c
8c -FVw sub.c
[...]
8c -FVw devwren.c
8l  -o 8.out fs.8 sub.8 porttime.8 fcall.8 iobuf.8 dat.8 main.8 dentry.8 fcallconv.8 ialloc.8 misc.8 con.8 console.8 chk.8 uid.8 auth.8 devwren.8

It's possible that Dan's comment about granularity referred to space,
not time.  The various source control systems just store diffs between
versions, but if you edit (and thus rewrite) a source file, the whole
file gets written to the dump.  Given the low cost of storage, that
seems quite acceptable.  Storing diffs to save space probably mattered
more in the mid-1970s when SCCS was written.