Skip to content

Commit

Permalink
added iossim alias, cleaned up some git-stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dflems committed Feb 7, 2013
1 parent 476a98e commit 90d6b78
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 7 deletions.
9 changes: 9 additions & 0 deletions 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
10 changes: 10 additions & 0 deletions 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
23 changes: 23 additions & 0 deletions 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
4 changes: 3 additions & 1 deletion git/gitconfig.symlink
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions osx/aliases.zsh
@@ -0,0 +1 @@
alias iossim="open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app"
3 changes: 2 additions & 1 deletion sublime2/User/Ruby.sublime-settings
Expand Up @@ -3,7 +3,8 @@
[
"podspec",
"ru",
"Guardfile"
"Guardfile",
"rabl"
],
"tab_size": 2,
"translate_tabs_to_spaces": true
Expand Down
19 changes: 14 additions & 5 deletions zsh/prompt.zsh
Expand Up @@ -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
Expand All @@ -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 () {
Expand Down

0 comments on commit 90d6b78

Please sign in to comment.