File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/zsh
2+
3+ amount=${1:- 10}
4+ array=(${(@ f)" $( git --no-pager log -n $amount --pretty=format:%s) " } )
5+ for (( i = 1 ; i <= $# array; i++ )) do
6+ key=" $i "
7+ if [[ $# i == 1 ]]; then
8+ key=" $key "
9+ fi
10+ echo " $key $array [i]"
11+ done
12+
13+ local choice
14+ echo " "
15+ read " choice?Commit to fixup?: "
16+ if [[ " $choice " -le " 0" ]]; then
17+ echo " No commit given.. Exiting."
18+ else
19+ local commits_back=$(( $choice - 1 ))
20+ git commit --fixup HEAD~$commits_back
21+ fi
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ ln -nfs "$(pwd)/zsh/.zsh" "$HOME/.zsh"
99ln -nfs " $( pwd) /.ruby-version" " $HOME /.ruby-version"
1010
1111ln -nfs " /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" " $HOME /.bin/sub"
12+ ln -nfs " $( pwd) /bin/git-fixup" " $HOME /.bin/git-fixup"
1213
1314SUBLIME_DIR=" $HOME /Library/Application Support/Sublime Text 2/Packages/User"
1415ln -nfs " $( pwd) /sublime/Preferences.sublime-settings" " $SUBLIME_DIR /Preferences.sublime-settings"
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ alias mou="open -a \"Mou.app\""
3434# Git
3535alias g=" open -a gitx ."
3636alias gs=" git status -sb"
37- alias gf=" git commit - -fixup"
37+ alias gf=" git-fixup"
3838alias gb=" git branch"
3939alias gc=" git checkout"
4040alias gm=" git merge"
You can’t perform that action at this time.
0 commit comments