Update 2024-12-26 17:21 OpenBSD/amd64-t14
This commit is contained in:
parent
3768436e21
commit
7c5d1f298f
8
.bin/g
8
.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
|
||||
|
@ -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: <commits> <env>"
|
||||
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" ]
|
||||
|
14
.kshrc
14
.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"
|
||||
|
@ -72,9 +72,7 @@ set fillchars+=foldopen:\🗁
|
||||
|
||||
set wildmode=full
|
||||
|
||||
""map :q map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
|
||||
nmap Q :qall!
|
||||
nmap k :HugoHelperLink
|
||||
nmap Q :qall!<cr>
|
||||
|
||||
let g:currentmode={
|
||||
\ 'n' : 'NORMAL',
|
||||
|
Loading…
Reference in New Issue
Block a user