<sdoc-main-legend
  data-testid="changelog-main-legend"
>
    <p>The Diff/Changelog feature only works when StrictDoc is run against a directory which is a Git repository.</p>
    <p>The left-hand-side (LHS) and the right-hand-side (RHS) revisions must be valid Git revisions.</p>
    <p>A valid revision can be a Git branch, a Git commit or a Git tag.</p>
    <p>Examples:</p>

    <div class="sdoc-table_key_value">
      <div class="sdoc-table_key_value-key">Git branch</div>
      <div class="sdoc-table_key_value-value">
        <code>main</code>
        <br>
        <code>origin/main</code>
      </div>
      <div class="sdoc-table_key_value-key">Git commit</div>
      <div class="sdoc-table_key_value-value">
        <code>63fd78411f864382349e951c51d3c4ce1b90fd28</code>
        <br>
        <code>63fd784</code>
      </div>
      <div class="sdoc-table_key_value-key">Git tag</div>
      <div class="sdoc-table_key_value-value">
        <code>v1.0.0</code>
      </div>
      <div class="sdoc-table_key_value-key">Custom</div>
      <div class="sdoc-table_key_value-value">
        <code>HEAD+</code>
        <br>
        <small>The StrictDoc's custom revision <code>HEAD+</code> can be used to indicate "the current branch + all uncommitted changes".</small>
      </div>
    </div>

    <p>The Diff/Changelog query is shareable via a URL.</p>
    <p>Example:</p>
    <div class="sdoc-table_key_value">
      {# djlint:off H022 #}
      <a href="http://127.0.0.1:5111/diff?left_revision=HEAD&right_revision=HEAD%2B&tab=diff"
         class="sdoc-table_key_value-key">HEAD vs. HEAD+</a>
      {# djlint:on #}
        <div class="sdoc-table_key_value-value">
        Open a diff between the last commit and the existing changes to the Git tree.
      </div>
    </div>

    <p>The StrictDoc diff algorithm compares documentation trees (left-hand side, LHS, and right-hand side, RHS) based on these principles:</p>
    <ul>
      <li>
        Optimal comparison of document contents is achieved using automatically-generated Machine Identifiers (MID). This ensures the best match.
      </li>
      <li>
        If document nodes, such as Sections or Requirements, lack MIDs, they are matched using their UID field. Matching quality with UIDs is comparable to that with MIDs, provided all nodes have UIDs.
      </li>
      <li>
        In cases where document nodes do not have either MID or UID, matching generally isn't performed or is very limited to the most basic cases. Changes to nodes lacking MID/UID are recorded as separate events: "node removed" for LHS and "node added" for RHS.
      </li>
    </ul>
</sdoc-main-legend>
