Skip to content

Using the {{diff}}, {{diff_added}}, and {{diff_removed}} notification tokens

reecespieces edited this page Mar 11, 2023 · 1 revision

What decides if a line is an addition, or a change, or a removal? The python diff() algorithm and how it perceives each change. It will not always provide consistent results.

In some cases, an addition or deletion might get detected as a change. So, in the notifications, lines that start with (into) might actually be new additions, and lines that start with (changed) might actually be lines that were removed from the page.

Example1:

capture In that example, Version 1.19.2-4.5.5 was removed from the page and Version 1.19.2-4.5.6 was added to the page. These lines are displayed in a table with the most recent one on the top. This caused the new lines to be detected as a change instead of an addition.

Example2:

capture In that example, the lines are also in a table with the most recent one on top. In the previous snapshot, the table was populated with the lines starting with (changed). In the current snapshot, the table only has a single entry which is the lines starting with (into). Yet in the notification, the removed lines start with (changed) and the new lines start with (into).

Lines that start with (changed) or (into) may also refer to lines that were already on the page that simply moved to a different place on the page.