[user]
 	email = github@elvis.ai
 	name = elvis kahoro

[alias]

  a         = "!graphite add"
  aa        = "!graphite add ."
  aaa       = aa
  aaaa      = aa
  absorb    = "!graphite absorb"
  ab        = absorb
  abb       = absorb
  abn       = absorb
  cab       = asborb
  ap        = "!graphite add --patch"
  au        = "!graphite add -u"
  aiu       = au
  ai        = au
  aui       = au
  gau       = au
  aq        = au
  qu        = au
  auy       = au
  auu       = au
  aug       = au
  ua        = au
  aui       = au
  gau       = au
  auq       = au
  aau       = au
  dau       = au
  gau       = au
  aug       = au
  auca      = "!graphite au && graphite ca"

  bc        = "!graphite create"
  gbc       = switch -c
  bcx       = bc
  bcdl      = bc
  cdl       = bc
  cb        = bc
  bce       = bc
  bvc       = bc
  bci       = "!graphite create --insert"
  gbc       = switch -c
  bcn       = "!graphite branch create --no-verify"
  be        = "!graphite downstack edit"
  gbl       = branch -a
  bl        = branch --list
  bd        = "!f() { if [ $# -eq 0 ]; then graphite down; else graphite down $1; fi }; f"
  bds       = bd
  db        = bd
  bp        = bd
  gbd       = bd
  bdd       = "!graphite down && git diff HEAD~$1"
  bdl       = "!graphite branch delete"
  brd       = "!graphite branch unbranch"
  gbrd      = branch -D
  bgrd      = gbrd
  brvd      = gbrd
  grb       = gbrd
  brd       = gbrd
  gdd       = gbrd
  grd       = gbrd
  gbdd      = gbrd
  grbd      = gbrd
  gbtd      = gbrd
  gbr       = gbrd
  gbd       = gbrd
  brf       = "!graphite branch fold"
  brsf      = brf
  brn       = "!graphite rename"
  rbn       = brn
  brsp      = "!graphite split"
  bsp       = brsp
  brsq      = "!graphite squash"
  brrsq     = brsq
  brt       = "!graphite track"
  bt        = brt
  btt       = bt
  btm       = "!graphite bottom"
  bu        = "!f() { if [ $# -eq 0 ]; then graphite up; else graphite up $1; fi }; f"
  bn        = bu
  by        = bu
  nu        = bu
  buu       = bu
  dbu       = bu
  lbu       = bu
  ub        = bu
  bug       = bu
  gbu       = bu
  buy       = bu
  buff      = "!graphite up && git push --force"
  #bucc     = "!graphite upstack test 'trunk check --fix --ignore-git-state'"
  bucc      = "!graphite up && trunk check --fix --filter=-trivy,-checkov,-osv-scanner,-semgrep"
  bcc       = bucc
  buc       = bucc
  bud       = "!graphite up && git diff HEAD~$1"
  bca       = "!graphite up && trunk check --fix --ignore-git-state --filter=-trivy,-checkov,-osv-scanner"

  ca        = "!graphite modify"
  ac        = ca
  aca       = ca
  cva       = ca
  gca       = commit --amend --no-edit --no-verify
  cam       = "!graphite modify"
  acam      = cam
  cvam      = cam
  acm       = cam
  cma       = cam
  canm      = cam
  cc        = "!trunk check --fix --filter=-trivy,-checkov,-osv-scanner,-semgrep"
  gcc       = cc
  cxc       = cc
  cca       = "!trunk check --fix --all --ignore-git-state"
  ccf       = cca
  #cca      = "!trunk check --fix --all --ignore-git-state --filter=-trivy,-checkov,-osv-scanner,-trufflehog"
  cac       = cca
  ccc       = cca
  ccca      = cca
  cfa       = !trunk fmt --all --ignore-git-state
  cl        = "!chalk lint"
  ccl       = cl
  chalk     = "!chalk"
  ch        = checkout
  cv        = ch
  gh        = ch
  hc        = ch
  bch       = ch
  hch       = ch
  gcvo      = ch
  cvh       = ch
  chr       = checkout run
  cloen     = clone
  cr        = chr
  check     = "!trunk check"
  co        = "! graphite modify -c"
  gco       = commit
  gcxo      = gco
  cgco      = gco
  gso       = gco
  ggco      = gco
  comit     = gco
  goc       = gco
  gcp       = gco
  com       = "!graphite commit -m"
  con       = "!graphite commit create --no-verify"
  gcon      = commit --no-verify
  ct        = "!graphite continue"
  ctr       = ct
  continue  = ct
  cp        = "!graphite cherry-pick"
  cpa       = "!graphite cherry-pick --abort"
  cpc       = "!graphite cherry-pick --continue"

  d         = "!f() { if [ $# -eq 0 ]; then git diff; else git diff HEAD~$1; fi }; f"
  dash      = "!gh dash"
  f         = d
  dd        = d 1
  d1        = d 1
  dc        = "!graphite diff --cached"
  dcd       = dc
  ddc       = dc
  ds        = "!f() { if [ $# -eq 0 ]; then git show --name-only; else git log --name-only -$1; fi }; f"
  dsr       = "!graphite downstack restack"
  dst       = "!graphite downstack test"
  dl        = "!f() { if [ $# -eq 0 ]; then git show --name-only; else git show --name-only HEAD~$(($1 - 1)); fi }; f"
  gdl       = dl
  dk        = dl
  ld        = dl
  dls       = dl
  ldl       = dl
  ddl       = dl
  dlk       = dl
  du        = "!less $(git ls-files --others --exclude-standard)"
  drun      = branch -D run

  g         = "!git"
  get       = "!graphite get"
  gh        = "!gh"
  git       = "!git"

  iit       = init
  int       = init
  inti      = init

  l         = "!graphite log --reverse --show-untracked"
  al        = l
  k         = l
  sl        = l
  ll        = "!graphite log short --reverse --show-untracked"
  ls        = ls-files
  gl        = log
  lt        = log --oneline

  m         = !git-m
  gm        = m
  dm        = m
  mmm       = "!git push . $(git symbolic-ref --short HEAD):main"
  mere      = merge
  mrege     = merge
  mege      = merge

  o         = "!gh pr view --web || gh repo view --web"
  open      = o
  go        = "!graphite pr"
  gfo       = go
  onto      = "!graphite upstack onto"

  pbd       = "!git push --no-verify origin --delete $(git branch --show-current)"
  pbf       = "!graphite push -u origin HEAD"
  pbdf      = "!git push --no-verify origin --delete $(git branch --show-current) && git push --no-verify -u origin HEAD"
  pl        = "!graphite pull"
  puill     = pl
  ipull     = pl
  poull     = pl
  pou       = pl
  pul       = pl
  oul       = pl
  oull      = pl
  ull       = pl
  pulp      = pl

  plm       = "!graphite fetch origin main:main"
  prev      = "!f() { if [ $# -eq 0 ]; then git checkout HEAD^1; else git checkout HEAD^$1; fi }; f"
  prv       = "!graphite pr"
  gpr       = "!gh pr create --web"

  pshy      = push
  pusuh     = push
  puis      = push
  puish     = push
  pushj     = push
  psu       = push
  pus       = push
  pusj      = push
  psuh      = push
  ppush     = push
  psh       = push
  puh       = push
  poush     = push
  oush      = push
  piush     = push
  pusdh     = push
  poiush    = push
  ush       = push
  pousr     = push
  puff      = push --force

  rse       = rs
  r         = "!f() { if [ $# -eq 0 ]; then git reset; else git reset HEAD~$1 --mixed; fi }; f"
  rest      = r
  reet      = r
  rset      = r
  rst       = r
  reest     = r
  res       = r
  e         = r
  rcb       = "!vim ~/.bashrc"
  rcg       = "!vim ~/.gitconfig"
  review    = "!f() { sha=$(git rev-parse HEAD) || return 1; if roborev list --json --limit 0 | jq -e --arg s \"$sha\" 'any(.[]; ((.git_ref // \"\") | startswith($s[0:12])) and .status != \"failed\")' >/dev/null 2>&1; then echo \"roborev: review already exists for ${sha:0:12} — skipping\"; else roborev review --wait \"$@\"; fi; }; f"

  rebae     = rebase
  reabse    = rebase
  rebse     = rebase
  rebae     = rebase
	roborev = !roborev

  rb        = "!graphite rebase"
  rba       = "!graphite rebase --abort"
  rbm       = "!graphite rebase main"
  rbc       = "!graphite continue"
  grbc      = rebase --continue
  reo       = "!graphite reorder"
  rr        = "!reflex run"
	rs = !graphite restack

  s         = status
  sg        = s
  gs        = s
  #ss       = "!gh pr create"
  ss        = "!gh pr create --fill --web"
  ssg       = "!gh pr create --web"
  sgs       = ssg
  sss       = ss
  sds       = ss
  gss       = ssg
  ssp       = ssg
  sw        = "!graphite switch"
  swc       = "!graphite switch -c"
  sh        = "!f() { if [ $# -eq 0 ]; then git show; else git show HEAD~$1; fi }; f"
  gsq       = "!f() { if [ $# -gt 2 ]; then echo "must be more than one"; else git rebase -i HEAD~$1; fi }; f"
  sta       = "!graphite stash"
  atash     = sta
  tas       = sta
  stah      = sta
  stahs     = sta
  stsh      = sta
  stsa      = sta
  tsash     = sta
  bta       = sta
  stahs     = sta
  tash      = sta
  stas      = sta
  sgta      = sta
  stcc      = stash clear
  stp       = "!graphite stash pop"
  spt       = stp
  stop      = stp
  tp        = stp
  sto       = stp
  sp        = stp
  stpo      = stp
  st        = "!graphite stash --patch"
  ta        = st
  astash    = stash
  stau      = "!graphite stash --include-untracked"
  stcc      = "!graphite stash clear"
  std       = "!graphite stash drop"
  tsd       = std
  setd      = std
  stdt      = std
  sted      = std
  stgd      = std
  std2      = "!graphite stash drop && graphite stash drop"
  stl       = "!graphite stash list"
  sts       = "!graphite stash show"

  sinit     = submodule init
  su        = submodule update
  sur       = submodule update --init --recursive
  sinitr    = sur

  smain     = "!git submodule foreach --recursive `git checkout main`"
  spull     = "!git submodule foreach --recursive `git pull`"
  spush     = "!f() { if [ $# -eq 0 ]; then git submodule foreach --recursive "git add ."; git submodule foreach --recursive "git commit -m c"; git push --recurse-submodules=on-demand; else git submodule foreach --recursive "git add ."; git submodule foreach --recursive "git commit -m $1"; git push --recurse-submodules=on-demand; fi } f"

  staash    = stash
  sstash    = submodule foreach --recursive "git stash"
  astsh     = stash
  sync      = "!graphite sync"

  t         = "!uv run pytest -n auto"
  test      = t
  top       = "!graphite top"
  vtop      = top
  op        = top
  otp       = top
  topd      = "!graphite top && graphite down"
  topn      = topd
  topb      = topd

  u         = au
  uso       = "!graphite move"
  usor      = uso
  usro      = uso
  usi       = uso
  usoi      = uso
  usso      = uso
  uos       = uso
  suo       = uso
  usp       = uso
  pusr      = "!git push && graphite restack --upstack"
  puysr     = pusr
  pisr      = pusr
  psir      = pusr
  psur      = pusr
  psr       = pusr
  jpusr     = pusr
  pusrt     = pusr
  usr       = "!graphite restack --upstack"
  us        = usr
  uisr      = usr
  usir      = usr
  usrt      = usr
  sur       = usr
  ust       = "!graphite upstack test"

  wls       = worktree list
  wsl       = worktree list

  x         = checkout -
  count-lines= "!git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #"

  caic      = "!DIFF=$(git diff --cached) && if [ -z \"$DIFF\" ]; then DIFF=$(git diff HEAD~1 HEAD) && AMEND=true; else AMEND=false; fi && if [ -z \"$DIFF\" ]; then echo \"Error: no staged changes and no previous commit to diff\" >&2; exit 1; fi && MSG=$(curl -s https://api.anthropic.com/v1/messages -H \"x-api-key: $ANTHROPIC_API_KEY\" -H \"anthropic-version: 2023-06-01\" -H \"content-type: application/json\" -d \"$(jq -n --arg diff \"$DIFF\" '{model:\"claude-haiku-4-5-20251001\",max_tokens:100,messages:[{role:\"user\",content:(\"Create a concise git commit message in conventional commits format (type: description). Return ONLY the message, nothing else.\\n\\n\" + $diff)}]}')\" 2>/dev/null | jq -r \".content[0].text\") && if [ -z \"$MSG\" ] || [ \"$MSG\" = \"null\" ]; then echo \"Error: API call failed to generate commit message\" >&2; exit 1; fi && if [ \"$AMEND\" = true ]; then git commit --amend -m \"$MSG\"; else git commit -m \"$MSG\"; fi"
  # cai       = !MSG=$(git aislc) && git commit -m \"$MSG\"
  caip      = !git caic && git push

  caix      = "!DIFF=$(git diff --cached) && if [ -z \"$DIFF\" ]; then DIFF=$(git diff HEAD~1 HEAD) && AMEND=true; else AMEND=false; fi && if [ -z \"$DIFF\" ]; then echo \"Error: no staged changes and no previous commit to diff\" >&2; exit 1; fi && MSG=$(curl -s https://api.openai.com/v1/responses -H \"Authorization: Bearer $OPENAI_API_KEY\" -H \"Content-Type: application/json\" -d \"$(jq -n --arg diff \"$DIFF\" '{model:\"gpt-4.1-mini\",input:[{role:\"system\",content:\"Write a concise git commit message in Conventional Commits format (type: description or type(scope): description). Return only the message.\"},{role:\"user\",content:(\"Create a commit message for this diff:\\n\\n\" + $diff)}],max_output_tokens:80,temperature:0.2}')\" 2>/dev/null | jq -r '.output_text // ([.output[]?.content[]?.text // empty] | join(\"\"))') && if [ -z \"$MSG\" ] || [ \"$MSG\" = \"null\" ]; then echo \"Error: API call failed to generate commit message\" >&2; exit 1; fi && if [ \"$AMEND\" = true ]; then git commit --amend -m \"$MSG\"; else git commit -m \"$MSG\"; fi"
  caiux     = caix
  caiox     = caix
  casix     = caix
  cax       = caix
  caiax     = caix
  acix      = caix
  ciax      = caix
  caux      = caix
  xai       = caix
  xaic      = caix
  caox      = caix
  caoix     = caix
  vaix      = caix
  cai       = caix

  bcw       = "!f() { git worktree add -b \"$1\" \"$(git rev-parse --show-toplevel)/worktrees/$1\" && echo \"$(git rev-parse --show-toplevel)/worktrees/$1\"; }; f"

  brw       = "!f() { branch=$(git -C \"$1\" rev-parse --abbrev-ref HEAD 2>/dev/null); git worktree remove \"$1\" && { [ -n \"$branch\" ] && git branch -d \"$branch\" 2>/dev/null; echo \"Removed worktree: $1${branch:+ (branch: $branch)}\"; }; }; f"
  gbrw      = "!f() { branch=$(git -C \"$1\" rev-parse --abbrev-ref HEAD 2>/dev/null); git worktree remove \"$1\" && { [ -n \"$branch\" ] && git branch -d \"$branch\" 2>/dev/null; echo \"Removed worktree: $1${branch:+ (branch: $branch)}\"; }; }; f"
  wd        = "!f() { branch=$(git -C \"$1\" rev-parse --abbrev-ref HEAD 2>/dev/null); git worktree remove \"$1\" && { [ -n \"$branch\" ] && git branch -d \"$branch\" 2>/dev/null; echo \"Removed worktree: $1${branch:+ (branch: $branch)}\"; }; }; f"

  branch-rename-with-ai = "!if ! git diff --cached --quiet; then echo \"Error: staged changes present; commit or unstage before running\" >&2; exit 1; fi && DIFF=$(git diff HEAD~1 HEAD 2>/dev/null) && if [ -z \"$DIFF\" ]; then echo \"Error: no previous commit to diff\" >&2; exit 1; fi && MSG=$(curl -s https://api.openai.com/v1/responses -H \"Authorization: Bearer $OPENAI_API_KEY\" -H \"Content-Type: application/json\" -d \"$(jq -n --arg diff \"$DIFF\" '{model:\"gpt-4.1-mini\",input:[{role:\"system\",content:\"Write a concise git branch name in kebab-case with a Conventional Commits prefix (e.g. feat/add-user-login, fix/typo-in-readme, chore/update-deps). Use 2-6 words after the slash. Return ONLY the branch name, no quotes, no trailing punctuation, no explanation.\"},{role:\"user\",content:(\"Create a branch name for this diff:\\n\\n\" + $diff)}],max_output_tokens:40,temperature:0.2}')\" 2>/dev/null | jq -r '.output_text // ([.output[]?.content[]?.text // empty] | join(\"\"))') && if [ -z \"$MSG\" ] || [ \"$MSG\" = \"null\" ]; then echo \"Error: API call failed to generate branch name\" >&2; exit 1; fi && printf \"%s\\n\" \"$MSG\""
  brai = !MSG=$(git branch-rename-with-ai) && graphite rename \"$MSG\"
  brau = brai

  aislc = "!DIFF=$(git diff --cached) && if [ -z \"$DIFF\" ]; then echo \"Error: no staged changes\" >&2; exit 1; fi && MSG=$(curl -s https://api.anthropic.com/v1/messages -H \"x-api-key: $ANTHROPIC_API_KEY\" -H \"anthropic-version: 2023-06-01\" -H \"content-type: application/json\" -d \"$(jq -n --arg diff \"$DIFF\" '{model:\"claude-haiku-4-5-20251001\",max_tokens:100,messages:[{role:\"user\",content:(\"Create a concise git commit message in conventional commits format (type: description). Return ONLY the message, nothing else.\\n\\n\" + $diff)}]}')\" 2>/dev/null | jq -r \".content[0].text\") && if [ -z \"$MSG\" ] || [ \"$MSG\" = \"null\" ]; then echo \"Error: API call failed to generate commit message\" >&2; exit 1; fi && printf \"%s\\n\" \"$MSG\""

  aiclx = "!DIFF=$(git diff --cached) && if [ -z \"$DIFF\" ]; then echo \"Error: no staged changes\" >&2; exit 1; fi && MSG=$(curl -s https://api.openai.com/v1/responses -H \"Authorization: Bearer $OPENAI_API_KEY\" -H \"Content-Type: application/json\" -d \"$(jq -n --arg diff \"$DIFF\" '{model:\"gpt-4.1-mini\",input:[{role:\"system\",content:\"Write a concise git commit message in Conventional Commits format (type: description or type(scope): description). Return only the message.\"},{role:\"user\",content:(\"Create a commit message for this staged diff:\\n\\n\" + $diff)}],max_output_tokens:80,temperature:0.2}')\" 2>/dev/null | jq -r '.output_text // ([.output[]?.content[]?.text // empty] | join(\"\"))') && if [ -z \"$MSG\" ] || [ \"$MSG\" = \"null\" ]; then echo \"Error: API call failed to generate commit message\" >&2; exit 1; fi && printf \"%s\\n\" \"$MSG\""
  bcai = !MSG=$(git aiclx) && graphite create -m \"$MSG\"
  bcao = bcai
  gcai = !MSG=$(git aiclx) && git commit -m \"$MSG\"

  tai = "!f() { sha=$(git rev-parse HEAD) || return 1; if roborev list --json --limit 0 | jq -e --arg s \"$sha\" 'any(.[]; ((.git_ref // \"\") | startswith($s[0:12])) and .status != \"failed\")' >/dev/null 2>&1; then echo \"roborev: review already exists for ${sha:0:12} — waiting\"; roborev wait \"$@\"; else roborev review --wait \"$@\"; fi; }; f"
	mt = "!f() { git push . \"$1\":main; }; f"

[init]
	defaultBranch = main

[fetch]
	prune = true

[pull]
	rebase = true

[push]
	default = simple
	autoSetupRemote = true

[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true

[core]
	excludesfile = /Users/elvis/.gitignore_global
	editor = vim
	pager = delta
	hooksPath = /Users/elvis/.config/git/hooks

[delta]
	navigate = true    # use n and N to move between diff sections
	line-numbers = true
	side-by-side = false
	features = dark-mode   # default; override per-shell with DELTA_FEATURES=light-mode

[delta "dark-mode"]
	light = false
	syntax-theme = Monokai Extended
	minus-style = red "#ffeeee"
	plus-style = green "#383830"

[delta "light-mode"]
	light = true
	syntax-theme = gruvbox-light
	minus-style = syntax "#ffd7d7"
	plus-style = syntax "#d7ffaf"

[diff]
	colorMoved = default

[color]
	status = auto
	diff = auto
	branch = auto
	interactive = auto
	grep = auto
	ui = auto

[interactive]
    diffFilter = delta --color-only

[stash]
    showStat = true
    showPatch = true

[merge]
	conflictstyle = diff3

[http]
	cookiefile = ~/.config/.gitcookies

[commit]
	template = ~/.config/git/.gitmessage

[credential "https://github.com"]
	helper = 
	helper = !/opt/homebrew/bin/gh auth git-credential

[credential "https://source.developers.google.com"]
	helper = gcloud.sh

[color "blame"]
	repeatedLines = bold 114
	highlightedLine = bold 226
	highlightedBoundary = bold 161
[coderabbit]
	machineId = cli/88a013c1cb39466287b4a9fee534ef17
[gitbutler]
	aiOpenAIKeyOption = butlerAPI
[credential "https://gist.github.com"]
	helper = 
	helper = !/opt/homebrew/bin/gh auth git-credential
[credential "https://dolthub.com"]
	username = elvis
	useHttpPath = true
[beads]
	role = maintainer
