Bill of materials and git-diff

Last year, I was assigned to a dry-dock campaign, and tasked with developing structural remediation scopes in an FPSO. Early on in the process, I made a decision to keep work scope (SOW) content separate from its associated bill of materials (BOM), imagining it would be handy to concatenate some day.

Using Typst, I was able to call the associated BOM as an immutable block of code within the SOW document like so:

#let qty = csv(scope.num + "-bom.csv")

#table(
  columns: 3,
  ..for (sl, description, quantity) in qty {
    (sl, description, quantity)
  }
)

With both SOW and BOM (in CSV) being plain text files meant I could track changes with git, of course.

Screenshot of scopes and BOM in a git tree
Scopes and BOM in a git tree.

Both these decisions, i.e., (a) separating BOM from SOW content, and (b) tracking changes with git, have served me well.

Recently, I was asked for a list of changes to the BOM between a previous revision and the latest. Since BOM was version-controlled with git, I could just run these following commands and get the diffs between, say, RevB (tag) and the latest update (HEAD).

View commit history:

git log RevB..HEAD -- '*.csv'

List filenames only:

git diff --name-only RevB..HEAD -- '*.csv'

View impact (stats):

git diff --stat RevB..HEAD -- '*.csv'

View line changes:

git diff -w --word-diff=plain RevB..HEAD -- '*.csv'

I could then generate a nice output (post a little clean-up), like below, for the shipyard to review and take account of.1

// Legend:
// - [-x-]: deletions
// - {+y+}: additions 

ST-163
1, PLT 10 THK (JIS G 3192 or equiv.), [-2-]{+4+} sq.m 
2, Coatings as per COMPANY spec. TGEN-S75-1001, [-2-]{+4+} sq.m

  1. Imagine doing this in Word, which comes with no-control kind of version control!