chore(git): refactor aliases and add bug sync

Amolith created

Move common git command aliases (e.g., commit, push, pull) from
fish shell configuration into the global git config. This
centralizes git-specific aliases in a single location.

Introduce dedicated fish functions `git-bug-pull` and `git-bug-push`
to facilitate synchronization of git-bug data, along with new git
aliases for them (`bugs`, `create-bug`). Also simplify the main `git`
alias in fish to just `g`.

Change summary

dot_config/git/config.tmpl                          | 17 ++++++++++++++
dot_config/private_fish/config.fish.tmpl            | 13 ----------
dot_config/private_fish/functions/git-bug-pull.fish |  8 +++++++
dot_config/private_fish/functions/git-bug-push.fish |  6 +++++
4 files changed, 31 insertions(+), 13 deletions(-)

Detailed changes

dot_config/git/config.tmpl 🔗

@@ -1,11 +1,26 @@
 [init]
 	defaultBranch = main
 [alias]
-	force-push = push --force-with-lease
+	fp = push --force-with-lease
 	dl = -c diff.external=difft log -p --ext-diff
 	ds = -c diff.external=difft show --ext-diff
 	df = -c diff.external=difft diff
 	patch = push rad HEAD:refs/patches
+	lazy = !lazygit
+	us = 'reset HEAD --'
+	sg = stage
+	ci = commit
+	co = checkout
+	wt = worktree
+	rb = rebase
+	br = branch
+	st = status
+	ps = push
+	pl = pull
+	bugs = bug bug
+	create-bug = bug bug new
+	push-bugs = !git-bug-push
+	pull-bugs = !git-bug-pull
 [user]
 	name = Amolith
 	email = amolith@secluded.site

dot_config/private_fish/config.fish.tmpl 🔗

@@ -134,18 +134,7 @@ if status is-interactive
     alias ls="lsd"
     alias loghtml="llm logs -ceu | mdas -h | grep '\.html\$' | read path_to_response && xdg-open \"LLM Responses/\$path_to_response\" && echo \"Opened \$path_to_response\""
     alias soft="ssh git.secluded.site"
-
-    # git aliases
-    alias lg="lazygit"
-    alias gc="git commit"
-    alias ga="git add"
-    alias gb="git branch"
-    alias gw="git worktree"
-    alias gr="git rebase"
-    alias gbb="git bug"
-    alias gps="git push"
-    alias gpl="git pull"
-    alias gfp="git force-push"
+    alias g="git"
 
 	scheme set tomorrow
     starship init fish | source

dot_config/private_fish/functions/git-bug-pull.fish 🔗

@@ -0,0 +1,8 @@
+function git-bug-pull
+    set -l remote (test -n "$argv[1]"; and echo $argv[1]; or git rev-parse --abbrev-ref --symbolic-full-name @{u} | cut -d'/' -f1)
+    echo "fetching bugs from '$remote' remote..." >&2
+    git fetch $remote "refs/bugs/*:refs/bugs/*" "refs/identities/*:refs/identities/*"
+
+    set git_dir (git rev-parse --git-dir)
+    test -d $git_dir/git-bug/cache/; and rm -rf $git_dir/git-bug/cache/
+end

dot_config/private_fish/functions/git-bug-push.fish 🔗

@@ -0,0 +1,6 @@
+function git-bug-push
+    set -l remote (test -n "$argv[1]"; and echo $argv[1]; or git rev-parse --abbrev-ref --symbolic-full-name @{u} | cut -d'/' -f1)
+
+    echo "pushing bugs to '$remote' remote..." >&2
+    git push $remote --prune "refs/bugs/*" "refs/identities/*"
+end