diff --git a/.bin/g b/.bin/g index fe74679..6b5d0ec 100755 --- a/.bin/g +++ b/.bin/g @@ -47,18 +47,20 @@ _branch=$(git --no-pager branch \ 2> /dev/null) [ -n "$_base" ] \ - && echo "# branch ($_branch) fork point: $_base" \ + && printf '%s\n' "# branch ($_branch) fork point: $_base" \ | sed "s/\(.\{$_width\}\).*/\1.../" _log=$(git --no-pager log \ + --reverse \ --abbrev-commit \ - --pretty=format:'%h | %an: %s' \ + --date=format:'%d.%m.%y %H:%S' \ + --pretty=format:'%h|%ad|%an: %s' \ ...origin/HEAD \ 2>/dev/null) if [ -n "$_log" ] then echo "# local commits" - echo "$_log" | sed "s/\(.\{$_width\}\).*/\1.../" + printf '%s\n' "$_log" | sed "s/\(.\{$_width\}\).*/\1.../" else echo "# no local commits" fi diff --git a/.bin/luakit-env b/.bin/luakit-env index c068121..a9ab46b 100755 --- a/.bin/luakit-env +++ b/.bin/luakit-env @@ -133,27 +133,6 @@ then vimdiff "$_dir/$f" "${_dir%$_env}$2/$f" fi -if [ "$_action" == "diffdir" ] -then - if test -z "$1" || test -z "$2" - then - echo "args: " - exit 1 - fi - flist="$(git --no-pager whatchanged \ - --oneline \ - --pretty=format:'' ...HEAD~$1 \ - | cut -d"M" -f2- \ - | sort -u \ - | xargs)" - for file in $flist - do - f="$(readlink -f $_oldpwd/$file)" - f="${file#$_dir}" - vimdiff "$_dir/$f" "${_dir%$_env}$2/$f" - done -fi - if [ "$_action" == "pr" ] then if [ -n "$1" ] diff --git a/.kshrc b/.kshrc index f50188c..12030b2 100644 --- a/.kshrc +++ b/.kshrc @@ -200,6 +200,20 @@ alias mygit-unstage="git restore --staged" alias mygit-untrack="git rm --cached" alias mygit-track="git add --intent-to-add" alias mygit-update="git fetch --all" +alias mygit-diff="git difftool -y ..origin/HEAD" +alias mygit-log="git log --graph" +alias mygit-branch="git --no-pager branch --all" +alias mygit-delete-branch="git branch -D" +mygit-checkout() { + _local="$(echo "$1" | sed 's,remotes/,,g;s,origin/,,g;')" + git checkout -b $_local $1 +} +alias mygit-changed-files="git --no-pager whatchanged origin/HEAD..HEAD | grep -E '^:' | awk '{ print \$6; }'" +mygit-diffbranch() { + for file in $(mygit-changed-files) + do + done +} mygot-clone() { if test -z "$1" || test -z "$2" diff --git a/.vim/vimrc b/.vim/vimrc index 2bbf8aa..555c84d 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -72,9 +72,7 @@ set fillchars+=foldopen:\🗁 set wildmode=full -""map :q map q :bpspbnbd -nmap Q :qall! -nmap k :HugoHelperLink +nmap Q :qall! let g:currentmode={ \ 'n' : 'NORMAL',