diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2013-10-10 16:18:47 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2013-10-10 16:20:54 +0200 |
commit | ac8ad37e9cec7b05f0f466ea10a2a052b9eb3d17 (patch) | |
tree | 2be698082a72cba4eadebf50b9be837f3026a4ea /.local | |
parent | 4ddb5e1770cb46a0a8e931dee9a556d3a5ebb5e5 (diff) | |
download | dotfiles-ac8ad37e9cec7b05f0f466ea10a2a052b9eb3d17.tar.gz dotfiles-ac8ad37e9cec7b05f0f466ea10a2a052b9eb3d17.tar.xz dotfiles-ac8ad37e9cec7b05f0f466ea10a2a052b9eb3d17.zip |
Git config: pwc alias displaying also underlying changes in patches
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/subwc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.local/bin/subwc b/.local/bin/subwc new file mode 100755 index 0000000..7a2c851 --- /dev/null +++ b/.local/bin/subwc @@ -0,0 +1,20 @@ +#!/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 |