{% set plus = [] %} {% set minus = [] %} {% set total_change = 0 %} {% for line in stdout %} {% if loop.index0 == 0 %}
{{ line }}
{% elif loop.index0 == 1 %} {{ line }}
{% elif line.startswith('-') and loop.index0 > 1 %}
{{ line }}
{% do minus.append(1) %} {% elif line.startswith('+') and loop.index0 > 2 %}
{{ line }}
{% do plus.append(1) %} {% elif line.startswith('@') %}
{{ line }}
{% else %}
{{ line }}
{% endif %} {% endfor %} {% set total_change = minus + plus %}
Total change: {{ total_change|length }}, additions: {{ plus|length }} & deletions: {{ minus|length }}