I currently use SCCS for source control, but this question applies to version control systems in general.
In order to determine when a piece of code originated, I sometimes open up SCCS s. files to poke around and match up the insertion commands around the code with the version headers. Of course, after a while these files become pretty hard to read that way.
Is there a way to 're-origin' an SCCS file so that the first stored version is whatever was there, say, 5 years ago - and only those deltas since then are preserved? I suppose that could be done by checking out each version you want and re-delta'ing them into a new repo, but somebody must have automated that process, no?
Or, better yet(?), is there a utility that will show the current version of a file annotated with the version # associated with each line? I just came across documentation for an 'annotate' command in bitkeeper. That the kind of thing I'm asking about. Oops. I see that the "sccs get -m" command does that (and I actually have an option in my sccs wrapper script to do it). Sorry - what a dope.
The first 're-origin' question still stands, though...
(I have to wonder why on Earth you're using SCCS.)
Such commands vary across different source control systems. SCCS is positively ancient, and is unlikely to have such a command.
In RCS (which is also ancient, but slightly more modern than SCCS), you can use the "-o" option to remove ("outdate") old versions of files. For example, if you have a file with stored revisions 1.1, 1.2, 1.3, ..., then you can use
to remove version 1.1 from the history, or
to remove revisions 1.1, 1.2, and 1.3.
For most modern systems, yes:
cvs annotate filenamesvn blame filename(alsopraise,annotate,ann)git blame filenamehg annotateorhg blameI don't believe either SCCS or RCS has such a command. It's easy to import RCS files into CVS (just copy
filename,vinto the CVS repo), and there are probably automated tools to convert an SCCS repo into an RCS repo.These commands show a line-by-line annotation of the current version of the file, which means they won't give you any information about deleted lines. For that, you can use some diff-like command to compare specified versions (
rcsdiff,cvs diff,svn diff,git diff,hg diff).