Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Forked from gilesbowkett/compare_branches.bash
Last active February 3, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baroquebobcat/7000485 to your computer and use it in GitHub Desktop.
Save baroquebobcat/7000485 to your computer and use it in GitHub Desktop.
function silencing_stderr() {
$* 2>/dev/null
}
function branch_names() {
git br | awk '{print $1}' | grep -v '*' | xargs
}
for branch_name in $(branch_names)
do
echo -n "${branch_name}: "
echo -n $'\t\t' # add a tab. Tabs are special. See http://superuser.com/questions/362235/how-do-i-enter-a-literal-tab-character-in-a-bash-shell
silencing_stderr git log -n 1 $branch_name | grep "Date: " | cut -c 9- | head -1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment