Skip to content

Instantly share code, notes, and snippets.

View kevinawoo's full-sized avatar

Kevin Woo kevinawoo

View GitHub Profile
#!/bin/bash
# git functions
__git_branch_info() {
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads | \
while read local remote
do
[ -z "$remote" ] && continue
git rev-list --left-right ${local}...${remote} -- 2>/dev/null >/tmp/git_upstream_status_delta || continue
LEFT_AHEAD=$(grep -c '^<' /tmp/git_upstream_status_delta)
/usr/local/bin/make-completion-wrapper:
#!/bin/sh
# Author.: Ole J
# Date...: 23.03.2008
# License: Whatever
# Wraps a completion function
# make-completion-wrapper <actual completion function> <name of new func.> <alias>
# <command name> <list supplied arguments>
# eg.
@kevinawoo
kevinawoo / ignore_moves.py
Last active September 1, 2015 22:14 — forked from RichardBronosky/ignore_moves.py
git diff ignore moved lines
#!/usr/bin/env python
"""
ignore_moves.py v0.2
Filter relocated lines from a unified diff format stream.
Offered under the terms of the MIT License at github.com
Taken from http://stackoverflow.com/questions/1380333/
"""
import sys
from optparse import OptionParser