HolySN

Script blame

Who wrote each line of a script field, when, and in which update set, the way git blame says it.

A Pro tool. Open it from the Blame button in a script field's toolbar, which blames that field, or with /blame in the palette, which blames every script on the form.

What you see

  • A column beside the line numbers. A stripe whose strength says how recent the line is, and on the first line of each block, the person and the age.
  • The line you are on. At its end, in faint text: who, when, and which update set.
  • A card. Click the column and it opens: the version, its date, its update set, what the line replaced, and a link to the version record itself.

The column folds to the left when you want the room back, and unfolds from the band at its edge.

Where the answer comes from

Every save of a tracked record leaves a version in sys_update_version, and each version holds the whole record as it was. Read oldest first, the script in those versions is the history of the script. Comparing each one with the next says which version brought in each line: a line nobody touched since keeps the version that wrote it, a line that changed belongs to the version that changed it.

A line is only pinned on someone through an unbroken chain of exact matches. Nothing is guessed.

Changes with no version

Two more stages follow the versions, when they differ from the last one:

  • The record as it is saved now. A change that left no version (an XML import, a script that wrote the field, versions cleaned up) is still a change. It is shown as "no version" rather than blamed on the last person who happened to leave one.
  • The text in the editor. Lines you typed and have not saved are marked as such, and follow your typing. The versions are read once; only this last stage is redone as you edit.

Where it works

Script fields on classic forms, drawn with Monaco on current releases and with CodeMirror on older ones. A form with several scripts, such as a UI action with a client and a server script, blames each field against its own history.

Names are shown as people ("Abel Tuter", not abel.tuter), each linked to the user record.

Script blame | HolySN