Skip to content

Instantly share code, notes, and snippets.

@natecavanaugh
Created July 5, 2011 04:12
Show Gist options
  • Save natecavanaugh/1064239 to your computer and use it in GitHub Desktop.
Save natecavanaugh/1064239 to your computer and use it in GitHub Desktop.
Alias to open a set of files in a commit
open = "!f() { editor=`git config --get user.editor`;files=`git show --pretty="format:" --name-only $1`;useopen=`command -v open`; usecygwin=`command -v cygstart`; [[ -n "$useopen" ]] && open -a $editor $files && exit $?; [[ -n "$usecygwin" ]] && editor=$(cygpath -d "$editor"); for i in $files; do echo "opening $i"; $usecygwin $editor $i; done }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment