Skip to content

Notes on using git with U2 SB XA

stuboydl edited this page Dec 15, 2020 · 4 revisions

Notes on using git with U2/SB/XA

As far a source control - using git is simple and effective.

  • Where possible, convert as many of your source files to type 19 (OS Folders) as possible. This will allow git to operate directly on folders that contain: Basic source, SB+ definitions (eg XXCONTROL, XXHELP, XXDEFN are all candidates for type 19), PAragraphs and any other text things that should be under source control.

  • Dictionaries should not be converted to type 19. They should be left as normal hash files as I-type dictionaries contain compiled binary and won't play well in a Type19. However, you can run a program to manage getting dictionaries (as source) in and out of a type 19 repository file before updating your source control system. Strip the binary code above attribute 9 from I-types and all should be good. I usually do this once a day to capture any changes.

An example program is in resources/GET.DICTS:

  • selects all dictionaries, compares each dictionary against a copy stored in the type 19 file, if it's changed it writes the the dictionary to the git tracked folder. Git then manages the changes to this file. Does the same for VOC entries. You could also use a trigger to write a change anytime a dictionary or VOC is updated.
  • NB be aware Windows only gotchas

    U2 doesn't play well with some Windows names restrictions/conventions when moving from hashed file to OS folder (type 19).

    eg "myitem." will have the trailing dot stripped when writing to windows, wheras "myItem*" will be converted to "myItem%A", for example.

    eg hashed file items starting with "aux.", "con.", etc. will fail when copied to type 19 files. eg an item called PRN.LABEL cannot be saved as a windows item!

Clone this wiki locally