Version numbers communicate how much a release changed.

version-policy Classifying a change helps a maintainer choose a version bump deliberately.

Version Policy

change
version_policy.pl
Replay: real traced execution (multi-file project)
use strict;
use warnings;

my $change = "bugfix";
my %bumps = (
    bugfix   => "patch",
    feature  => "minor",
    breaking => "major",
);
my $bump = $bumps{$change};
my $requires_notes = $bump eq "major" ? "yes" : "no";

print "change=$change\n";
print "bump=$bump\n";
print "requires_notes=$requires_notes\n";
use strict;
use warnings;

my $change = "feature";
my %bumps = (
    bugfix   => "patch",
    feature  => "minor",
    breaking => "major",
);
my $bump = $bumps{$change};
my $requires_notes = $bump eq "major" ? "yes" : "no";

print "change=$change\n";
print "bump=$bump\n";
print "requires_notes=$requires_notes\n";
use strict;
use warnings;

my $change = "breaking";
my %bumps = (
    bugfix   => "patch",
    feature  => "minor",
    breaking => "major",
);
my $bump = $bumps{$change};
my $requires_notes = $bump eq "major" ? "yes" : "no";

print "change=$change\n";
print "bump=$bump\n";
print "requires_notes=$requires_notes\n";
  1. $change ← bugfix, %bumps ← 3, $bump ← patch, $requires_notes ← no

    4my $change→ bugfix = "bugfix"; #@change="feature", "breaking"5my %bumps→ 3 = (6    bugfix   => "patch",7    feature  => "minor",8    breaking => "major",9);10my $bump→ patch = $bumps{$change}patch;11my $requires_notes→ no = $bumppatch eq "major" ? "yes" : "no";1213print "change=$changebugfix\n";14print "bump=$bumppatch\n";15print "requires_notes=$requires_notesno\n";
    outputchange=bugfix
    bump=patch
    requires_notes=no
  1. $change ← feature, %bumps ← 3, $bump ← minor, $requires_notes ← no

    4my $change→ feature = "feature";5my %bumps→ 3 = (6    bugfix   => "patch",7    feature  => "minor",8    breaking => "major",9);10my $bump→ minor = $bumps{$change}minor;11my $requires_notes→ no = $bumpminor eq "major" ? "yes" : "no";1213print "change=$changefeature\n";14print "bump=$bumpminor\n";15print "requires_notes=$requires_notesno\n";
    outputchange=feature
    bump=minor
    requires_notes=no
  1. $change ← breaking, %bumps ← 3, $bump ← major, $requires_notes ← yes

    4my $change→ breaking = "breaking";5my %bumps→ 3 = (6    bugfix   => "patch",7    feature  => "minor",8    breaking => "major",9);10my $bump→ major = $bumps{$change}major;11my $requires_notes→ yes = $bumpmajor eq "major" ? "yes" : "no";1213print "change=$changebreaking\n";14print "bump=$bumpmajor\n";15print "requires_notes=$requires_notesyes\n";
    outputchange=breaking
    bump=major
    requires_notes=yes