From 323405477ab684cb5c6dfc201aaa032dba3c86f0 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Sun, 18 Mar 2012 23:52:07 +0800 Subject: [PATCH] If $NOTIFY is set, use notify-send to send git repo update notifications --- lib/git/repo_index.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/git/repo_index.sh b/lib/git/repo_index.sh index 10b8091..30c24c1 100644 --- a/lib/git/repo_index.sh +++ b/lib/git/repo_index.sh @@ -231,10 +231,14 @@ _git_index_update_all_branches() { # (see http://stackoverflow.com/a/2934062/304706) if [[ "$branch_rev" != "$(git rev-parse ${remotes[$index]}/${merges[$index]})" ]] && \ [[ "$(git merge-base $branch_rev ${remotes[$index]}/${merges[$index]})" = "$branch_rev" ]]; then - echo "=== Updating '$branch' branch in $base_path from ${remotes[$index]}/${merges[$index]}..." + echo "=== Updating $branch branch in $base_path from ${remotes[$index]}/${merges[$index]}..." # Checkout branch if we aren't already on it. if [[ "$branch" != "$(parse_git_branch)" ]]; then git checkout $branch; fi git merge "${remotes[$index]}/${merges[$index]}" + # Send UI notification of update + if [ "$NOTIFY" = "true" ]; then + notify-send "Updated $(basename $base_path) [$branch]" "from ${remotes[$index]}/${merges[$index]}" + fi fi let index++ done