commit 2826073c6065614013023d7c67f1e603dd10ee75
parent b9fec83ae3d1a611e50b721f19698f53ef84db90
Author: Robert Russell <robert@rr3.xyz>
Date: Mon, 27 Jul 2026 01:27:29 -0700
Turn Git config into graft package (WIP)
Diffstat:
7 files changed, 162 insertions(+), 11 deletions(-)
diff --git a/.gitconfig b/.gitconfig
@@ -1,11 +0,0 @@
-[user]
- email = robert@rr3.xyz
- name = Robert Russell
-[init]
- defaultBranch = master
-[pull]
- rebase = true
-#[url "git@github.com:"]
-# insteadOf = https://github.com/
-[protocol "gits"]
- allow = always
diff --git a/git/.config/git/allowed_signers b/git/.config/git/allowed_signers
diff --git a/git/.config/git/config b/git/.config/git/config
@@ -0,0 +1,157 @@
+[user]
+ email = robert@rr3.xyz
+ name = Robert Russell
+ # signingkey = ~/.ssh/id_ed25519.pub
+
+[branch]
+ sort = -committerdate # Most recently-used branches first
+[commit]
+ # gpgSign = true
+ verbose = true # Show diff in commit message editor
+[diff]
+ algorithm = histogram
+ colorMoved = default # Color differently content that was merely moved
+ mnemonicPrefix = true # c/, i/, w/ instead of a/, b/
+ renames = copies # Detect copies in addition to renames
+ submodule = log
+[fetch]
+ parallel = 0 # "0" means based on CPU count
+ prune = true # Prune remote branches, not (potentially local-only) tags
+ recurseSubmodules = on-demand
+[gpg]
+ format = ssh
+ [ssh]
+ allowedSignersFile = ~/.config/git/allowed_signers
+[init]
+ defaultBranch = main
+[log]
+ date = iso
+[merge]
+ conflictStyle = zdiff3
+[pull]
+ rebase = true
+[push]
+ autoSetupRemote = true
+ recurseSubmodules = check
+[rebase]
+ autoSquash = true
+ autoStash = true
+[rerere]
+ enabled = true
+ autoUpdate = true
+[stash]
+ showPatch = true
+ showIncludeUntracked = true
+[status]
+ showUntrackedFiles = all
+ submoduleSummary = true
+[submodule]
+ recurse = true
+ fetchJobs = 0 # "0" means based on CPU count
+[tag]
+ sort = version:refname
+
+# TODO?: !git i && echo && git l -5
+# TODO: fetch, tags, worktree-specific stashes (somehow)
+[alias]
+ # Info
+ i = status --short --branch --
+
+ # Log
+ l = log --oneline --graph --decorate
+ la = !git l --source $(git for-each-ref --format='%(refname:short)') --
+ last = log -1 --stat
+ lahead = !git fetch -q && git log --oneline @{push}..HEAD # On HEAD but not push target
+ lbehind = !git fetch -q && git log --oneline HEAD..@{upstream} # On upstream but not HEAD
+
+ # List files
+ lst = ls-files --cached -- # tracked
+ lsu = ls-files --other -- # untracked
+ lsd = ls-files --deleted -- # deleted
+ lsm = ls-files --modified -- # modified
+ lsi = ls-files --ignored --other --exclude-standard -- # ignored
+
+ # TODO: Review and clean up
+ # Diff
+ d = diff
+ di = diff
+ ds = diff --staged
+ dh = diff HEAD
+ cmp = diff X Y
+
+ # TODO: Review and clean up
+ # Remote
+ remotes = remote -v show -n --
+ pushf = push --force-with-lease
+
+ # TODO: Review and clean up
+ # Setup
+ # initb = "!f() { git init --bare \"${1:-.}\"/.git; }; f"
+ # cloneb = "!f() { git clone --bare \"$1\" \"${2:-.}\"/.git; }; f"
+ cloner = clone --recurse-submodules
+
+ # Branches
+ bsw = switch --
+ bmksw = switch --create --
+ bmk = "!f() { [ $# -ge 1 ] || exit 1; git branch -- "$@"; }; f"
+ bls = branch --list --
+ bcp = branch --copy --
+ bmv = branch --move --
+ brm = branch --delete --
+
+ # TODO: Review and clean up
+ # Index
+ a = add
+ aa = add --all
+ ap = add --patch
+ unstage = restore --staged
+
+ # TODO: Review and clean up
+ # Commit
+ c = commit
+ amend = commit --amend --no-edit
+ fixup = commit --fixup
+ squash = commit --squash
+ hotfix = cherry-pick -x
+
+ # TODO: Review and clean up
+ # Rebase
+ r = rebase
+ ra = rebase --abort
+ rc = rebase --continue
+ ri = rebase --interactive
+
+ # TODO: Review and clean up
+ # Stash
+ s = stash
+ sl = stash list
+ sr = stash pop # "stash restore"
+ ss = stash push --include-untracked # "stash save"
+
+ # TODO: Review and clean up
+ # Submodule
+ m = submodule
+ mu = submodule update --init --rebase --recursive
+
+ # TODO: Review and clean up
+ # Worktrees
+ w = worktree
+ wmk = worktree add
+ wls = worktree list
+ wmv = worktree move
+ wrm = worktree remove
+ inspect = worktree add --detach
+
+# Prefer SSH for pushing to GitHub
+[url "git@github.com:"]
+ pushInsteadOf = https://github.com/
+
+# Forbid insecure protocols
+[protocol "git"]
+ allow = never
+[protocol "http"]
+ allow = never
+
+# Allow gits (git-over-TLS)
+[protocol "gits"]
+ allow = always
diff --git a/git/.graft.sh b/git/.graft.sh
@@ -0,0 +1,5 @@
+link .config/git
+
+# for f in .local/bin/*; do
+# link "$f"
+# done
diff --git a/git/.local/bin/git-cloneb b/git/.local/bin/git-cloneb
diff --git a/git/.local/bin/git-initb b/git/.local/bin/git-initb
diff --git a/git/.local/bin/git-trust b/git/.local/bin/git-trust