Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (17 sloc) 590 Bytes
#!/bin/bash
# Inspired by various stackoverflow posts.
# For post I'm using t twitter client, and not some fancy http_post.
toplevel_path=`git rev-parse --show-toplevel`
toplevel_dir=`basename "$toplevel_path"`
branch=`git rev-parse --abbrev-ref HEAD`
subject=`git log --pretty=format:%s -n1`
hashtags="#code"
mention="@ankitrgadiya"
tweet="$hashtags $toplevel_dir:$branch $subject by $mention"
# truncate tweets that are longer than 140 characters
if [ ${#tweet} -gt 140 ]
then
tweet_trunc=$(echo $tweet | cut -c1-137)
tweet=${tweet_trunc}...
fi
t update "$tweet"