Skip to content

Instantly share code, notes, and snippets.

@cxreg
Created February 26, 2013 21:17
Show Gist options
  • Select an option

  • Save cxreg/5042287 to your computer and use it in GitHub Desktop.

Select an option

Save cxreg/5042287 to your computer and use it in GitHub Desktop.
git-only
#!/bin/sh
opts=$(git rev-parse --no-revs "$@" 2>/dev/null)
rev=$(git rev-parse --revs-only "$@" 2>/dev/null)
branch=$(git name-rev --name-only ${rev:-HEAD})
upstream=$(git name-rev --name-only --refs 'refs/remotes/*' --no-always $branch@{u} 2>/dev/null)
git log $(git rev-parse --not --remotes --branches | grep -v $(git rev-parse $branch) | grep -v ${upstream:-XXX}) $branch $opts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment