.gitconfig
5db7ac8d
 [include]
 	path = ~/.gitconfig-user
f390fe17
 
 [core]
 	; Git sets `$LESS` to `FRX` if it's not already set. `X` disables
 	; sending termcap initialization and deinitialization strings to the
 	; terminal, which leaves (potentially log) text on the screen and
 	; disables mouse scrolling.
 	pager = less -+X
2e17f723
 	hooksPath      = ~/.githooks
 	excludesFile   = ~/.gitignore
 	attributesFile = ~/.gitattributes
 
 [init]
 	templateDir = ~/.gittemplate
4f72424d
 	defaultBranch = master
 	; defaultBranch = main
 
 [remote]
 	pushDefault = origin
 
 [push]
 	default = current
 	recurseSubmodules = check
 
 [branch]
 	autoSetupMerge  = always
 	autoSetupRebase = always
 
 [fetch]
 	prune     = true
 	pruneTags = true
 
 [rebase]
 	autoSquash = true
 	autoStash  = true
 	updateRefs = true
 	missingCommitsCheck = error
 
 [pull]
 	rebase = merges
 
 [merge]
 	ff = false
 	autoStash = true
9d589e56
 	conflictStyle = diff3
 
 [am]
 	threeWay = true
 
 [rerere]
 	enabled = true
 
 [diff]
 	renames   = copies
 	algorithm = histogram
db8f7fd7
 
 [url "ssh://git@"]
 	pushInsteadOf = https://
 
 [protocol]
 	allow = never
 
 [protocol "file"]
 	allow = always
 
 [protocol "ssh"]
 	allow = always
 
 [protocol "https"]
 	allow = always
 
 [transfer]
 	fsckObjects = true
 
 [fsck]
 	zeroPaddedFilemode = warn
 	badTimezone        = warn
 
 [receive "fsck"]
 	zeroPaddedFilemode = warn
 	badTimezone        = warn
 
 [fetch "fsck"]
 	zeroPaddedFilemode = warn
 	badTimezone        = warn
284a7ed7
 
 [notes]
 	rewriteRef = refs/notes/commits
 
 [format]
 	notes = true
ebbb3ebc
 
 [status]
 	showStash = true
 	submoduleSummary = true
 
 [log]
 	abbrevCommit = true
 	decorate = short
061fc08f
 
 [log]
 	date = relative
 
 [blame]
 	date = relative
d99afd19
 
 [log]
 	graphColors = \
 	  BrightRed, \
 	  BrightGreen, \
 	  BrightYellow, \
 	  BrightBlue, \
 	  BrightMagenta, \
 	  BrightCyan
 
 [diff]
 	colorMoved   = zebra
 	colorMovedWS = ignore-space-change
 
 [color "diff"]
 	meta                      = BrightBlue
 	frag                      =       Blue
 	func                      =       Blue
 	commit                    = BrightYellow
 	whitespace                = BrightRed
 	plain                     =       Yellow
 	context                   = BrightWhite
 	contextBold               = BrightWhite
 	contextDimmed             =       White
 	old                       = BrightRed
 	oldBold                   = BrightRed
 	oldDimmed                 =       Red
 	new                       = BrightGreen
 	newBold                   = BrightGreen
 	newDimmed                 =       Green
 	oldMoved                  = BrightMagenta
 	oldMovedDimmed            =       Magenta
 	oldMovedAlternative       =       Magenta
 	oldMovedAlternativeDimmed =       Magenta
 	newMoved                  = BrightCyan
 	newMovedDimmed            =       Cyan
 	newMovedAlternative       =       Cyan
 	newMovedAlternativeDimmed =       Cyan
 
 [blame]
 	coloring = repeatedLines
 	; coloring = highlightRecent
 
 [color "blame"]
 	repeatedLines = White
 	highlightRecent = \
 	  245, 1  years ago, \
 	  246, 6 months ago, \
 	  247, 5 months ago, \
 	  248, 4 months ago, \
 	  249, 3 months ago, \
 	  250, 2 months ago, \
 	  251, 4  weeks ago, \
 	  252, 3  weeks ago, \
 	  253, 2  weeks ago, \
 	  254, 1  weeks ago, \
 	  255
31397d45
 
 [absorb]
 	; https://github.com/tummychow/git-absorb
 	maxStack = 100
0778b9bc
 
 [pretty]
dc6ec210
 	patch    =  format:%C(BrightYellow)commit %h%C(auto)%d%n%C(BrightYellow)Author: %aN <%aE>%n%C(BrightYellow)Date:   %ad%n%n%C(Yellow)%s%n
 	compact  = tformat:%C(BrightYellow)%h%x20%C(BrightMagenta)%>(13,trunc)%ar%x20%C(BrightBlue)%<(15,trunc)%aN%x20%C(BrightWhite)%s%C(auto)%d
 	compactt = tformat:%C(BrightYellow)%h%x09%C(BrightMagenta)%>(1       )%ar%x09%C(BrightBlue)%<(1       )%aN%x09%C(BrightWhite)%s%C(auto)%d
0778b9bc
 
 [alias]
4b11cc1b
 	; All.
 	all = "!f() { : ; \
 	  [ -t 1 ] && terminal=y; \
 	  git config --get-colorbool color.all && color_all=always; \
 	  git config --get-colorbool color.ui  && color_ui=always; \
 	  find . -type d -name '*.git' -prune \
 	  | sed 's#^\\./\\.git$\\|^\\./\\|/\\.git$##g' \
 	  | sort \
 	  | awk '{ \
 	    for (parent in parents) \
 	      if ($0 ~ \"^\" parent) \
 	        next; \
 	    parents[$0]; \
 	    print; \
 	  }' \
 	  | { \
 	    if [ $# -eq 0 ]; \
 	    then \
 	      if [ $terminal ]; \
 	      then \
 	        tree -n ${color_all+-C} --fromfile; \
 	      else \
 	        cat; \
 	      fi; \
 	    else \
 	      if [ $color_all ]; \
 	      then \
 	        get_color() { git -C \"$path\" config --get-color \"$@\"; }; \
 	        color_reset=$(get_color '' reset); \
 	        color_all_header=$(get_color color.all.header yellow); \
 	      fi; \
 	      while read -r path; \
 	      do \
 	        output=$(git -C \"$path\" -c color.ui=$color_ui \"$@\" 2>&1); \
 	        [ \"$output\" ] || continue; \
 	        printf '%s%s%s\\n%s\\n\\n' \
 	          \"$color_all_header\" \
 	          \"$path\" \
 	          \"$color_reset\" \
 	          \"$output\"; \
 	      done; \
 	    fi; \
 	  } \
 	  | eval \"LESS=${LESS-FRX} $(git var GIT_PAGER)\"; \
 	}; f"
 
57141ac4
 	; Tree.
 	tree = "!f() { : git ls-files ; \
 	  git config --get-colorbool color.tree && color_tree=always; \
 	  git ls-files \"$@\" | tree -n ${color_tree+-C} --fromfile; \
 	}; f"
 
79010c10
 	; Users.
 	users = "!f() { : git log ; \
 	  git log --pretty=full \"$@\" \
 	  | sed -n 's/^\\(Author\\|Commit\\): \\(.*\\)/\\2/p' \
 	  | sort -u; \
 	}; f"
 
bb378048
 	; Browse.
 	browse ="!f() { : ; \
 	  set --; \
 	  urls=\"$(git remote get-url ${@:-$(git remote)})\"; \
 	  for url in $urls; \
 	  do \
 	    echo $url; \
 	    { [ $(command -v xdg-open) ] && xdg-open \"$url\"; } || \
 	    { [ $(command -v open)     ] && open     \"$url\"; } || \
 	    { [ $(command -v start)    ] && start    \"$url\"; } || \
 	    echo \"$@\"; \
 	  done; \
 	}; f"
 
a9f10ce7
 	; Refdiff.
 	refdiff = "!f() { : git diff ; \
 	  git config --get-colorbool color.diff && color_diff=always; \
 	  git reflog --pretty='format:%h: %gs' \
 	  | awk -F': ' '$2~/(commit|rebase).*\\((amend|finish)\\)/{print $1}' \
 	  | while read -r ref; \
 	  do \
 	    git -c color.diff=$color_diff show --no-patch $ref; \
 	    echo; \
 	    git -c color.diff=$color_diff diff \"$@\" $ref HEAD; \
 	    echo; \
 	  done \
 	  | eval \"LESS=${LESS-FRX} $(git var GIT_PAGER)\"; \
 	}; f"
 
ae719c80
 	; Filter meta.
 	filter-meta = "!f() { : git filter-branch ; \
 	  name=\"$1\";  shift; \
 	  email=\"$1\"; shift; \
 	  git filter-branch \"$@\" --env-filter \" \
 	    GIT_AUTHOR_NAME=\\\"$name\\\"; \
 	    GIT_AUTHOR_EMAIL=\\\"$email\\\"; \
 	    GIT_COMMITTER_NAME=\\\"$name\\\"; \
 	    GIT_COMMITTER_EMAIL=\\\"$email\\\"; \
 	    GIT_COMMITTER_DATE=\\\"\\$GIT_AUTHOR_DATE\\\"; \
 	  \" ; \
 	}; f"
 
0778b9bc
 	; Log.
dc6ec210
 	l = "!f() { : git log ; \
 	  git config --get-colorbool color.diff && color_diff=always; \
 	  git -c color.diff=$color_diff log --graph --pretty=compactt \"$@\" \
 	  | sed -E 's/^([^\\t]+\\t[^\\t,]+)(,.+)? ago(.*\\t.*)$/\\1\\3/' \
 	  | sed -E 's/^(.*) +(.*[0-9a-f]{7}.*\\t)/\\1\\t\\2/' \
 	  | sed -E 's/ *$//' \
 	  | column -t -o ' ' -s \"$(printf '\\t')\" \
 	  | eval \"LESS=${LESS-FRX} $(git var GIT_PAGER)\"; \
 	}; f"
0778b9bc
 	ls = log --oneline --decorate=no
 	lf = log --first-parent
 	lp = log --patch --pretty=patch
 	lpw  = lp --color-words='[_[:alnum:]]+|[^[:space:]]'
 	lpww = lp --color-words='.'
 	la    = l    --all
 	lsa   = ls   --all
 	lfa   = lf   --all
 	lpa   = lp   --all
 	lpwa  = lpw  --all
 	lpwwa = lpww --all
 
 	; Status.
 	s  = status
 	ss = status --short
 	sb = status --short --branch
 	sa  = s  --ignored
 	ssa = ss --ignored
 	sba = sb --ignored
 
 	; Diff.
 	d  = diff
 	du = diff @{upstream}
 	dp = diff @{push}
 	dc  = d  --cached
 	duc = du --cached
 	dpc = dp --cached
 	dw   = d   --color-words='[_[:alnum:]]+|[^[:space:]]'
 	duw  = du  --color-words='[_[:alnum:]]+|[^[:space:]]'
 	dpw  = dp  --color-words='[_[:alnum:]]+|[^[:space:]]'
 	dcw  = dc  --color-words='[_[:alnum:]]+|[^[:space:]]'
 	ducw = duc --color-words='[_[:alnum:]]+|[^[:space:]]'
 	dpcw = dpc --color-words='[_[:alnum:]]+|[^[:space:]]'
 	dww   = d   --color-words='.'
 	duww  = du  --color-words='.'
 	dpww  = dp  --color-words='.'
 	dcww  = dc  --color-words='.'
 	ducww = duc --color-words='.'
 	dpcww = dpc --color-words='.'
 
 	; Add.
 	au = add -u
 	aa = add -A
 
 	; Commit.
 	c  = commit
 	ca = commit --amend
 
 	; Rebase.
 	ri = rebase -i
 	ro = rebase -i --root
 	rr = rebase --continue
 
 	; Fetch.
 	f = fetch
 
 	; Push.
 	p  = push
 	pf = push --force-with-lease
 
 	; Clean ignored files (requires either `-f`, `-i` or `-n`).
 	x = clean -Xd
 
 	; Contains.
 	contains = tag --contains
 	; contains = describe --contains