3

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.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Brent.Longborough
  • 9,567
  • 10
  • 42
  • 62
  • You say you want to ignore, yet preserve the sequence numbers. Sorry, but that sounds like a contradiction. If the sequence number changes between revisions, which one should be preserved? –  May 10 '09 at 12:25
  • I guess by 'ignore' he just means that it should exclude the sequence numbers from diffing. Still, I don't understand how this should work with patching. – mooware May 10 '09 at 13:13
  • Okay,then you should be fine with resequencing them, right? We used to punch new decks with new sequence numbers all the time. (Yes, I said "punch new decks". I used cards. Deal with it.) – Charlie Martin May 10 '09 at 18:37
  • @Charlie: Yep, I still use cards, too. I've still got a couple of boxes (unpunched), which I use to take notes. *I* would be fine with resequencing; but it makes life extremely complicated for the stuff back on the mainframe (especially SMP/E). – Brent.Longborough May 10 '09 at 19:41

4 Answers4

3

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
  • 854,459
  • 170
  • 1,222
  • 1,395
2

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.

Community
  • 1
  • 1
Noldorin
  • 144,213
  • 56
  • 264
  • 302
1

(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
  • 93,541
  • 22
  • 172
  • 341
1

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
  • 110,348
  • 25
  • 193
  • 263