Diff Reports

This section uses the example module below (test/pass/test3a.yang) to demonstrate the different report formats available. The old module revision is test/pass/test3.yang.

The following command is used in all 3 examples, except the value of the --difftype parameter is changed each time. The <enum> is explained below.

> yangdiff-pro --old=test3a --new=test3 --difftype=<enum>

Terse Report

If --difftype=terse is selected, then a brief summary of all changes will be listed. There will be no indentation, and only the change (Add, Modify, Delete), and the top-level definition is identified.

// old: test3a (2009-09-09) test3a.yang
// new: test3 (2008-10-19) test3.yang

M module from 'test3a' to 'test3'
M namespace
D revision '2009-09-09'
A revision '2008-10-19'
D feature X
D identity testbase
D identity testbase1
M typedef C
M container test33
A container test-D1
A leaf test-D

Normal Report

If --difftype=normal is selected, then a complete summary of all changes will be listed.

If a change line is indented, it indicates a sub-statement of the object in the previous line has been changed.

// old: test3a (2009-09-09) test3a.yang
// new: test3 (2008-10-19) test3.yang

M module from 'test3a' to 'test3'
M namespace
D revision '2009-09-09'
A revision '2008-10-19'
D feature X
D identity testbase
D identity testbase1
M typedef C
  M type
    M range from 'min .. 41' to 'min .. 41 | 45'
M container test33
  A presence 'not a top-level mand...'
  M choice f
    M case f1
      M leaf f1
        D if-feature 'X'
A container test-D1
A leaf test-D

Revision Statement

If --difftype=revision is selected, then a complete summary of all changes will be printed in the form of a YANG revision statement. The current date will be used for the revision-date field of the revision statement.

// old: test3a (2009-09-09) test3a.yang
// new: test3 (2008-10-19) test3.yang

  revision 2022-01-06 {
    description "
      - Changed module from 'test3a' to 'test3'
      - Changed namespace
      - Removed revision '2009-09-09'
      - Added revision '2008-10-19'
      - Removed feature X
      - Removed identity testbase
      - Removed identity testbase1
      - Changed typedef C
        - Changed type
          - Changed range from 'min .. 41' to 'min .. 41 | 45'
      - Changed container test33
        - Added presence 'not a top-level mand...'
        - Changed choice f
          - Changed case f1
            - Changed leaf f1
              - Removed if-feature 'X'
      - Added container test-D1
      - Added leaf test-D
    ";
  }