Created
February 27, 2018 18:28
-
-
Save skeggse/8f7c856a8aac7097122fa4531dce7ad9 to your computer and use it in GitHub Desktop.
Revisions
-
skeggse created this gist
Feb 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/bin/bash INTERVAL=1 afile="$(mktemp)" bfile="$(mktemp)" function show_diff() { a="$1" b="$2" diff="$(git diff --no-index --color "$b" "$a" | tail -n +5)" if [[ "$diff" != '' ]]; then date echo "$diff" fi } "$@" | tee "$bfile" echo while true; do sleep 1 "$@" > "$afile" show_diff "$afile" "$bfile" sleep 1 "$@" > "$bfile" show_diff "$bfile" "$afile" done rm "$afile" "$bfile"