Skip to content

Instantly share code, notes, and snippets.

View mpiette's full-sized avatar

Marc Piette mpiette

  • Startup
  • San Francisco
  • 15:19 (UTC -08:00)
View GitHub Profile
function reviewnow {
git checkout -b quickdiff-$(date "+%Y-%m-%dT%H-%M-%S")
git commit -a -m "$1"
arc diff --verbatim --allow-untracked --reviewers $2
}
Usage: Edit some files when on master, leaving them modified but not added; then run reviewnow msg reviewer. Here's an example:
$ git branch
@mpiette
mpiette / gist:fbe1d5af0da80bb629c7cf43ec7e2b69
Created September 2, 2016 16:06
ssh completion - known_hosts
# complete ssh from known_hosts
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Custom bash prompt via kirsle.net/wizards/ps1.html
export PS1="\[$(tput setaf 6)\]\u\[$(tput setaf 7)\]@\[$(tput setaf 2)\]\h\[$(tput sgr0)\]\[$(tput setaf 7)\]:\[$(tput sgr0)\]\[$(tput setaf 5)\]\W\[$(tput sgr0)\]\[$(tput bold)\]\[$(tput setaf 3)\]\$(parse_git_branch)\[$(tput sgr0)\]\[$(tput setaf 7)\] \\$ \[$(tput sgr0)\]"