Permalink
Browse files

If $NOTIFY is set, use notify-send to send git repo update notifications

  • Loading branch information...
1 parent 5944f8c commit 323405477ab684cb5c6dfc201aaa032dba3c86f0 @ndbroadbent ndbroadbent committed Mar 18, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/git/repo_index.sh
View
@@ -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

0 comments on commit 3234054

Please sign in to comment.