#!git-config
; @(#)🏠📂 HOMEDIR	.gitconfig	2026-04-05T19:22:43Z
; SPDX-FileCopyrightText: 2026 Lady <https://www.ladys.computer/about/#lady>
; SPDX-License-Identifier: CC0-1.0

;; ⁌ Git configuration
;;
;; This file provides some basic Git configuration.
;; It is intended to be included from a user‐level Git configuration
;;   file; user‐specific settings like name and email are not provided.

;; § Git aliases

[alias]

;; ❦ `install-hooks´
;;
;; Installs the hooks in the `*/githooks´ subdirectories of
;;   `../HOMEDIR´ as symlinks.

	install-hooks = "!: \"${path_HOMEDIR:=$(realpath ../HOMEDIR)}\" ; for file in \"${path_HOMEDIR}\"/*/githooks/* ; do : ; hookname=\"$(printf '%s\n' \"${file}\" | sed 's/^.*[/]\\([^/]*\\)[.][^/.]*$/\\1/')\" ; ln -fs \"${file}\" \"${GIT_DIR}\"/hooks/\"${hookname}\" ; done"

;; ❦ `rename´
;;
;; Functions like `git commit --amend --reset-author´, but keeps the
;;   date of the commit.

	rename = "!git commit --amend --reset-author --no-edit --date=\"$(git show -s | sed '/^Date:/!d;/^Date:/s/Date: *//')\""

;; ❦ `showmsg´
;;
;; Prints the message of the current HEAD.

	showmsg = "!git show -s | sed '/^ \\{4\\}/!d;s/ \\{4\\}//'"

;; § Color settings

;; ❦ Branch color settings
;;
;; Use yellow for the current branch and cyan for the remote branch.

[color "branch"]
	current = yellow
	remote = cyan

;; ❦ Diff color settings
;;
;; Use bold red for new content and blue for outdated content.

[color "diff"]
	old = blue
	new = red bold

;; § Commit settings

[commit]

;; Do not sign commits.
;; This is the default, but override any system configuration to do
;;   so.

	gpgsign = false

;; § Core settings

[core]

;; Use CotEditor as the editor if it is defined; otherwise, use nano.

	editor = "if command -v cot; then cot --wait \"$@\"; else nano \"$@\"; fi; true"

;; Use composed forms of filenames, not decomposed forms, on macOS.

	precomposeUnicode = true

;; Don¦t escape non‐Ascii characters in paths.

	quotepath = false


;; § Initialization settings

[init]

;; Use `🆕´ as the default branch name.

	defaultbranch = 🆕

;; § Pull settings

[pull]

;; Only allow fastforward pulls.

	ff = only
