blob: c455f58e3961f7565c9275495c709a6b274f5fba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/bin/sh
set -eu
[ -n "${DEBUG:-}" ] && set -x
case "${1:-status}" in
git)
[ $# -gt 0 ] && shift
exec /usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME $*
;;
st | status)
exec $0 git status -sb --untracked-files=yes
;;
add)
shift
exec $0 git add -f $*
;;
commit | snapshot | record)
shift
$0 git commit --all --trailer=Automated-commit-by:dots --trailer=signoff --gpg-sign --message=* $*
echo
$0 git log --stat --format=full -1
echo
;;
push)
set -x
$0 git push inazuma || true
$0 git push origin || true
;;
untracked)
shift
exec $0 git ls-files -o $*
;;
edit)
$0 git ls-files --full-name $HOME |
fzf --layout=reverse --height='~60%' \
--bind=enter:replace-query+become:"nvim $HOME/{q}"
;;
*)
echo "dots has its own subcommands, if you want git, run dots git [git command]"
;;
esac
|