Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: StephenBrown2/dotfiles
base: 17fa48293a
...
head fork: StephenBrown2/dotfiles
compare: b1f63caa31
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
60 bin/git-divergence
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -e
+
+(
+ function branch() {
+ git branch 2>/dev/null | grep -e '^*' | tr -d '\* '
+ }
+
+ function ensure_valid_ref() {
+ ref=$1
+ (
+ set +e
+ git show-ref $ref > /dev/null
+ if [[ $? == 1 ]]; then
+ echo "$0: bad ref: $ref"
+ exit 1
+ fi
+ )
+ }
+
+ function show_rev() {
+ rev=$1
+ git log -1 $rev --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
+ echo
+ git di $rev^..$rev | diffstat
+ echo
+ }
+
+ if [[ $# == 2 ]]; then
+ LOCAL=$1
+ REMOTE=$2
+ elif [[ $# == 1 ]]; then
+ LOCAL=`branch`
+ REMOTE=$1
+ else
+ LOCAL=`branch`
+ REMOTE=origin/$LOCAL
+ fi
+
+ ensure_valid_ref $LOCAL
+ ensure_valid_ref $REMOTE
+
+ echo "changes from local ${LOCAL} to remote ${REMOTE}:"
+ echo
+
+ echo incoming:
+ echo
+ for rev in `git rev-list $LOCAL..$REMOTE`; do
+ show_rev $rev
+ done
+
+ echo
+ echo outgoing:
+ echo
+ for rev in `git rev-list $REMOTE..$LOCAL`; do
+ show_rev $rev
+ done
+) | less -r
+
View
4 bin/git-goodness
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+git diff $* | gn
+
View
31 bin/gn
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+
+#
+# Print a diff summary like:
+#
+# $ git diff 'master~10..master' | gn
+# 293 lines of diff
+# 185 lines added
+# 19 lines removed
+# +166 lines net change
+
+import sys, os, re, fileinput
+
+def get_lines(diff_lines):
+ # Added lines start with '+' (but not '+++', because that marks a new
+ # file). The same goes for removed lines, except '-' instead of '+'.
+ added_lines = [line for line in diff_lines
+ if line.startswith('+') and not line.startswith('+++')]
+ removed_lines = [line for line in diff_lines
+ if line.startswith('-') and not line.startswith('---')]
+ return added_lines, removed_lines
+
+
+if __name__ == '__main__':
+ diff_lines = list(fileinput.input())
+ added_lines, removed_lines = get_lines(diff_lines)
+ print '%i lines of diff' % len(diff_lines)
+ print '%i lines added' % len(added_lines)
+ print '%i lines removed' % len(removed_lines)
+ print '%+i lines net change' % (len(added_lines) - len(removed_lines))
+
View
1  bin/gn.py
View
21 create-links
@@ -8,6 +8,27 @@
for file in [a-zA-Z]* ; do
if [[ "$file" != "create-links" && "$file" != "README" && "$file" != "README.md" ]] ; then
+ if [[ "$file" == "bin" ]]; then
+ if [[ ! -d ~/bin || ! -h ~/bin ]] ; then
+ ln -s `pwd`/bin ~/;
+ elif [[ -d ~/bin && ! -h ~/bin ]]; then
+ for binfile in bin/[a-zA-Z]* ; do
+ if [[ -h ~/"$binfile" ]] ; then
+ echo " Removing symbolic link ~/$binfile"
+ rm ~/"$binfile"
+ elif [[ -a ~/"$binfile" ]] ; then
+ date=$(date '+%FT%T');
+ echo " ~/$binfile exists. Moving it to ~/$binfile.back.$date"
+ mv ~/"$binfile" ~/"$binfile".back.$date || echo "Couldn't move ~/$binfile to ~/$binfile.back.$date!"
+ fi
+
+ echo "ln -s `pwd`/\"$binfile\" ~/\"$binfile\"" && echo "Linked ~/$binfile to `pwd`/$binfile" || echo "Couldn't link ~/$binfile to `pwd`/$binfile!"
+ #ln -s `pwd`/bin/"$binfile" ~/bin/"$binfile" && echo "Linked ~/bin/$binfile to `pwd`/bin/$binfile" || echo "Couldn't link ~/bin/$binfile to `pwd`/bin/$binfile!"
+ done
+ fi
+ continue
+ fi
+
if [[ -h ~/."$file" ]] ; then
echo " Removing symbolic link ~/.$file"
rm ~/."$file"
View
14 gitconfig
@@ -41,6 +41,13 @@
ds = diff --stat=160,120
dh1 = diff HEAD~1
+ # Divergence (commits we added and commits remote added)
+ div = divergence
+
+ # Goodness (summary of diff lines added/removed/total)
+ gn = goodness
+ gnc = goodness --cached
+
# Fancy logging.
# h = head
# hp = head with patch
@@ -50,9 +57,12 @@
# la = all commits, all reachable refs
head = !git l -1
h = !git head
- hp = "!source ~/.githelpers && show_git_head"
+ hp = "!. ~/.githelpers && show_git_head"
r = !git l -30
ra = !git r --all
- l = "!source ~/.githelpers && git_log_pretty"
+ l = "!. ~/.githelpers && git_log_pretty"
la = !git l --all
lg = !git l --graph
+
+[merge]
+ tool = vimdiff
View
3  sh_aliases
@@ -1,5 +1,8 @@
# ~/.sh_aliases
+# Add paths
+export PATH="$HOME/bin:$PATH"
+
# User-specific aliases to be used in a bash or zsh session
alias sudo='PATH=$PATH:/usr/local/bin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin /usr/bin/sudo'
View
3  vimrc
@@ -46,7 +46,6 @@ endif
set nohlsearch " turn off highlighting for searched expressions
set incsearch " highlight as we search however
set matchtime=5 " blink matching chars for .x seconds
-set mouse=a " try to use a mouse in the console (wimp!)
set ignorecase " set case insensitivity
set smartcase " unless there's a capital letter
set completeopt=menu,longest,preview " more autocomplete <Ctrl>-P options
@@ -126,4 +125,4 @@ autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
"------ END VIM-500 ------"
-endif " version >= 500

No commit comments for this range

Something went wrong with that request. Please try again.