#!/bin/bash # to be used in pipe after "git whatchanged", this adds # info about files touched by the contained patches; # requires patchutils package installed local line while read line; do case "${line}" in *.patch*) echo "${line}" lsdiff --addprefix " " -s -- ${line##*[AMD]} 2>/dev/null \ | sed -e 's|^\(!.*\)|\x1b\[0;34m\1\x1b\[0m|' \ -e 's|^\(+.*\)|\x1b\[0;32m\1\x1b\[0m|' \ -e 's|^\(-.*\)|\x1b\[0;31m\1\x1b\[0m|' ;; *) echo "${line}";; esac done