[user]
    name = Tony Grosinger
    email = tony@grosinger.net
[color]
    ui = auto

[color "status"]
    added = green
    branch = white bold ul
    changed = 9    # Bright red
    unmerged = 11  # Bright yellow
    untracked = 32 # Brighter blue

[alias]
    co = checkout
    amend = commit --amend
    cf = commit --fixup
    aq = commit --amend --no-edit
    c = commit
    pf = push --force-with-lease
    s = status -sb
    b = branch
    pp = log --color --graph --pretty=format:'%Cred%h%Creset %Cgreen(%cr) %Creset\t%s %C(bold blue)<%an> %C(yellow)%d%Creset' --abbrev-commit
    type = cat-file -t
    dump = cat-file -p
    hist = log --pretty=format:\"%C(yellow)%h %C(blue)%cd %C(red)%d %C(reset)%s %C(green)[%an]\" --decorate --graph --date=short --all
    ri = "!f() { r=\"${1}\"; if [ \"${1}\" -eq \"${1}\" ]; then r=\"@~${1}\"; \
                 fi >/dev/null 2>&1; git rebase --autosquash -i \"${r}\"; }; f"
    review = "!f(){ BRANCH=\"$(git rev-parse --abbrev-ref HEAD)\"; git push -u origin \"$BRANCH\":user/$USER/\"$BRANCH\" --force; }; f"

    # Branch-agnostic aliases
    # https://aj.codes/post/branch-agnostic-git-aliases/
    default-branch = "!git symbolic-ref refs/remotes/origin/HEAD | cut -f4 -d/"
    pom = push origin $(git default-branch)
    merged-branches = "!git branch --merged $(git default-branch)"
    sync = "!git fetch -p && git rebase origin/$(git default-branch)"

[core]
    editor = /home/linuxbrew/.linuxbrew/bin/nvim
    pager = delta
    attributesfile = /home/tgrosinger/.gitattributes
    excludesfile = /home/tgrosinger/.gitignore_global

[help]
    autocorrect = prompt

[interactive]
    diffFilter = delta --color-only

[push]
    default = simple
    autoSetupRemote = true

[diff]
    colorMoved = default
    algorithm = histogram
    mnemonicPrefix = true
    renames = true

[include]
    path = /home/tgrosinger/.config/delta/themes/catppuccin.gitconfig

[delta]
    # Does not behave well for comments
    #features = catppuccin-latte
    navigate = true
    light = true
    side-by-side = true
    line-numbers = true
    #map-styles = bold purple => syntax magenta, bold cyan => syntax blue

[branch]
    autosetuprebase = always
    sort = -committerdate

[rebase]
    autoSquash = true
    autoStash = true
    updateRefs = true

[tag]
    sort = version:refname

[pull]
    rebase = true

[log]
    date = local

[status]
    submoduleSummary = true

[url "ssh://git@gitlab.i.extrahop.com/"]
    insteadOf = https://gitlab.i.extrahop.com/

[merge]
    conflictstyle = zdiff3

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