Skip to content

Instantly share code, notes, and snippets.

View breyten's full-sized avatar

Breyten Ernsting breyten

View GitHub Profile
@breyten
breyten / list_tsv_column.sh
Created April 1, 2013 10:57
List a specific field of a tab separated file using AWK
#!/bin/sh
/usr/bin/awk '
BEGIN {
FS="\t";
FIELD_NAME="'$1'";
print FIELD_NAME;
}
NR == 1 {
@breyten
breyten / hg-close-inactive-branches.sh
Last active February 22, 2019 11:17
Automatically close inactive mercurial branches (use with care!)
for i in `hg branches |grep -v 'default' |grep -v 'production' |grep inactive |awk '{print $1}'`; do hg update $i && hg commit -m "close branch" --close-branch; done
@breyten
breyten / git-branches-by-commit-date.sh
Last active December 12, 2015 03:28 — forked from jasonrudolph/git-branches-by-commit-date.sh
List unmerged branches with the latest commit message for each branch
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch --no-merged`;do echo -e `git show --abbrev-commit --format="%ci %d %s" $branch | head -n 1`; done | sort -r