Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added iossim alias, cleaned up some git-stuff

  • Loading branch information...
commit 90d6b786bb87d929d3bc97ae376634f957ef9693 1 parent 476a98e
@dflems authored
View
9 git/bin/git-attic
@@ -0,0 +1,9 @@
+#!/bin/sh
+# git-attic [-M] [PATH] - list deleted files of Git repositories
+#
+# Use -M to not show renamed files, and other git-log options as you like.
+
+git log --raw --no-renames --date=short --format="%h %cd" "$@" |
+ awk '/^[0-9a-f]/ { commit=$1; date=$2 }
+ /^:/ && $5 == "D" { print date, commit "^:" $6 }' |
+ git -p column
View
10 git/bin/git-neck
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+# git neck [-r] [COMMIT] - show commits until first branching point
+
+[ "$1" = -r ] && shift && R=-r
+COMMIT=$(git rev-parse --no-flags --default HEAD "$@")
+# skip first elements of trail
+TORSO=$(git trail $R $COMMIT | cut -d' ' -f2 | uniq | sed -n 2p)
+# fall back to initial commit on empty trail
+: ${TORSO:=$(git rev-list --max-parents=0 HEAD)}
+git log --oneline $(git rev-parse --no-revs "$@") $COMMIT...$TORSO
View
23 git/bin/git-trail
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+# git trail [-r] [-t] [COMMIT] - show all branching points in Git history
+
+[ "$1" = -r ] && shift || REMOTES="-e refs/remotes/"
+[ "$1" = -t ] && shift || TAGS="-e refs/tags/"
+COMMIT=$(git rev-parse --no-flags --default HEAD "$@")
+
+{ git for-each-ref | grep -v -e '^$' $TAGS $REMOTES
+ git log --date=short --format="%cd %h %H" "$@"
+} | awk '
+ $2 == "commit" || $2 == "tag" {
+ "git merge-base '$COMMIT' " $1 | getline mb
+ merge[mb] = merge[mb] " " $3
+ }
+ {
+ if ($3 in merge) {
+ split(merge[$3], mbs, " ")
+ for (i in mbs) {
+ "git name-rev --name-only --refs=\"" mbs[i] "\" " $3 | getline nr
+ if (nr != "undefined") print $1, $2, nr # skip unreachable commits
+ }
+ }
+ }' | git -p column # paginate output
View
4 git/gitconfig.symlink
@@ -31,7 +31,7 @@
gn = goodness
gnc = goodness --cached
- # Fancy logging.
+ # Fancy logging
# h = head
# hp = head with patch
# r = recent commits, only current branch
@@ -45,6 +45,8 @@
ra = !git r --all
l = "!. ~/.githelpers && pretty_git_log"
la = !git l --all
+
+ news = log -p HEAD@{1}..HEAD@{0}
[color]
diff = auto
status = auto
View
1  osx/aliases.zsh
@@ -0,0 +1 @@
+alias iossim="open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app"
View
3  sublime2/User/Ruby.sublime-settings
@@ -3,7 +3,8 @@
[
"podspec",
"ru",
- "Guardfile"
+ "Guardfile",
+ "rabl"
],
"tab_size": 2,
"translate_tabs_to_spaces": true
View
19 zsh/prompt.zsh
@@ -2,17 +2,24 @@ autoload colors && colors
# cheers, @ehrenmurdick
# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh
+if (( $+commands[git] ))
+then
+ git="$commands[git]"
+else
+ git="/usr/bin/git"
+fi
+
git_branch() {
- echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
+ echo $($git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
}
git_dirty() {
- st=$(/usr/bin/git status 2>/dev/null | tail -n 1)
+ st=$($git status 2>/dev/null | tail -n 1)
if [[ $st == "" ]]
then
echo ""
else
- if [[ $st == "nothing to commit (working directory clean)" ]]
+ if [[ "$st" =~ ^nothing ]]
then
echo "on %{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}"
else
@@ -22,12 +29,14 @@ git_dirty() {
}
git_prompt_info () {
- ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return
+ ref=$($git symbolic-ref HEAD 2>/dev/null) || return
+# echo "(%{\e[0;33m%}${ref#refs/heads/}%{\e[0m%})"
echo "${ref#refs/heads/}"
}
unpushed () {
- /usr/bin/git cherry -v @{upstream} 2>/dev/null
+ $git cherry -v `$git config --get branch.master.remote`/$(git_branch) 2>/dev/null
+ #$git cherry -v @{upstream} 2>/dev/null
}
need_push () {
Please sign in to comment.
Something went wrong with that request. Please try again.