views:

134

answers:

4

I'm looking at migrating a large suite of IBM Assembler Language programs, from a vcs based on "filenames include version numbers", to a modern vcs which will give me, among other things, the ability to branch and merge.

These files have 80-column records, the last 8 columns being an almost-meaningless sequence number.

For a number of reasons which I don't really want to waste space by going into, I need the vcs to ignore (but hopefully preserve in some well-defined manner) the sequence number columns, and to diff and patch based only on the contents of the first 72 columns.

Any ideas?


Just to clarify "ignore but preserve": I accept it's a bit vague, as I haven't fully collected my ideas yet.

It would be something along the lines of this:

"When merging/patching, if one side has sequence numbers, output them; if more-than-one side has sequence numbers, use those present in file (1|2|3)"


Why do I want to preserve sequence numbers? First, they really are sequence numbers. Second, I want to reintegrate this stuff back onto the mainframe, where sequence numbers can be terribly significant. (Those of you who know what "SMP/E" means will understand. Those who don't, be happy, but tremble...)


I've just realised I hadn't accepted an answer. Difficult choice, but @Noldorin comes closest to where I have to go.

+2  A: 

I believe any modern version control system (Subversion and Bazaar are the ones I would typically recommend, being centralised and distributed respectively) can utilise an external diff/merge tool. Unfortunately, I would think you would have to write this custom merge tool yourself (at least I have never heard of one that does that you need), though this shouldn't be a huge task I would imagine. Saying that, you may have some luck with the recommendations given in this StackOverflow question as well as this one. Sorry I can't give any more information as to which ones you'll want to look into in particular, but it's worth having a browse through in case that any of them do happen to satisfy your requirements.

Noldorin
Dunno about the "merge" part, but writing a good diff tool is actually pretty hard.
Ira Baxter
+4  A: 

In Mercurial, you could easily ignore columns 73-end of .asm files -- just add to your .hgrc the following lines:

[encode]
*.asm: cut -b -72

(or slightly more complex ways if you want to support Windows systems as well;-). However this wouldn't meet the "preserve" part of your "ignore but preserve" spec (which, as Neil's comment points out, is somewhat problematic in itself).

Alex Martelli
+1  A: 

I think the meaning of "preserve" is the key here. When you say the sequence numbers are "almost meaningless", does that "almost" include anything besides sequence? In the Dreamtime, we used to encode a sort of program flow chart over there (you can find an example in the First Edition of Brooks' Mythical Man Month) but that practice has thankfully died out.

If the only meaning of the sequence numbers columns are as an ordered sequence of numbers. I'd be tempted to use @Alex's approach — you can preprocess files from a script in any of the modern VC tools — to cut the sequence numbers, then when you extract a file, use an analogous tool to resequence the records again.

Charlie Martin
A: 

(Disclosure: I represent the vendor of tool described in this answer).

What you want is a diff tool that understands that the stuff in columns 72-80 is "whitespace" regardless of the facts that you've filled it with characters.

The Semantic Designs COBOL Smart Differencer has an IBM Enterprise COBOL variant that understands this just fine.

SD makes Smart Differencers for a variety of langauges, and IBM Assembler is a future target. Contact SD offline for discussion about a Smart Differencer for IBM Assembler, if you are interested.

Ira Baxter