Skip to content

Instantly share code, notes, and snippets.

@devguydavid
devguydavid / git-push-gerrit
Created February 13, 2013 00:28
A helpful alias for git/gerrit integration.
push-gerrit = "!bash -c ' \
local_ref=$(git symbolic-ref HEAD); \
local_name=${local_ref##refs/heads/}; \
remote=$(git config branch.\"$local_name\".remote || echo origin); \
remote_ref=$(git config branch.\"$local_name\".merge); \
remote_name=${remote_ref##refs/heads/}; \
remote_review_ref=\"refs/for/$remote_name\"; \
r=\"\"; \
if [[ $0 != \"\" && $0 != \"bash\" ]]; then r=\"--reviewer=$0\"; fi; \
if [[ $1 != \"\" ]]; then r=\"$r --reviewer=$1\"; fi; \
" Smooth Scroll
"
" Remamps
" <C-U>
" <C-D>
" <C-F>
" <C-B>
"
" to allow smooth scrolling of the window. I find that quick changes of
" context don't allow my eyes to follow the action properly.
#!/bin/bash
set -e
function cleanup {
echo "Removing /tmp/foo"
rm -r /tmp/foo
}
trap cleanup EXIT
mkdir /tmp/foo
asdffdsa #Fails