Browse files

Adding super awesome "ged" function.

  • Loading branch information...
1 parent b93d412 commit aa63347e3e46ecb25e29694191856de7a60e1db5 @cowboy committed Jul 12, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 source/50_vcs.sh
View
12 source/50_vcs.sh
@@ -25,6 +25,18 @@ alias grv='gr -v'
alias grr='git remote rm'
alias gcl='git clone'
+# open all changed files (that still actually exist) in the editor
+function ged() {
+ local files=()
+ for f in $(git diff --name-only "$@"); do
+ [[ -e "$f" ]] && files=("${files[@]}" "$f")
+ done
+ local n=${#files[@]}
+ echo "Opening $n $([[ "$@" ]] || echo "modified ")file$([[ $n != 1 ]] && \
+ echo s)${@:+ modified in }$@"
+ q "${files[@]}"
+}
+
# add a github remote by github username
function gra() {
if (( "${#@}" != 1 )); then

0 comments on commit aa63347

Please sign in to comment.