{ pkgs, lib, config, ... }: { programs.git = { ignores = [ "*~" "*.swp" ]; package = lib.mkDefault pkgs.gitFull; aliases = { authors = "shortlog -s -n"; }; extraConfig = { push.default = "simple"; color.diff = "auto"; #color.diff.whitespace = "red reverse"; color.status = "auto"; color.branch = "auto"; core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol"; core.quotepath = "false"; alias.s = "status -s"; alias.st = "status"; alias.ci = "commit"; alias.br = "branch"; alias.co = "checkout"; alias.dc = "diff --cached"; alias.df = "diff"; alias.dh = "diff --histogram"; alias.dp = "diff --patience"; alias.lp = "log -p"; alias.ll = "log --graph --decorate --pretty=oneline --abbrev-commit"; alias.ign = "ls-files -o -i --exclude-standard"; alias.spull = "!git-svn fetch && git-svn rebase"; alias.spush = "!git-svn dcommit"; alias.fetch-local = "!git fetch local && git tag -d $(git describe --exact-match 2>/dev/null >/dev/null) && git fetch --tags local"; alias.pull-local = "!git fetch-local && git checkout -B master local/master"; alias.pull-local-old = "!git fetch-local && git checkout HEAD'^' && git branch -f master local/master && git checkout master"; alias.root = ''!git rev-list --parents HEAD | egrep "^[a-f0-9]{40}$"''; alias.has-tag-version = ''!git show-ref --tags -d | grep -qx \"^$(git rev-parse HEAD) refs/tags/v[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]\\(\\^{}\\)\\?\"''; alias.tag-version = ''"!git has-tag-version && return; v=$(TZ=UTC date +v%Y-%m-%d) && name=$(git rev-parse --show-toplevel | sed -e 's:^.*/work::') && set -x && git tag -s -m \"$name $v\" $v"''; alias.has-tag-majordate = ''!git show-ref --tags -d | grep -qx \"^$(git rev-parse HEAD) refs/tags/v[0-9]\\+.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\\(\\^{}\\)\\?\"''; alias.tag-majordate = ''"!git has-tag-majordate && return; name=$(basename $(dirname $(git rev-parse --show-toplevel))); major=$(basename $(git rev-parse --show-toplevel)); version=''${version:-$(TZ=UTC date +\"v$major.%Y%m%d\")} && set -x && git tag -s -m \"$name $version\" $version"''; alias.tag-cabal = ''"!set -x; for cabal in $(git ls-files | grep '.*\\.cabal$'); do name=$(sed -ne 's/^name: *\\(.*\\)/\\1/p' \"$cabal\"); version=$(sed -ne 's/^version: *\\(.*\\)/\\1/p' \"$cabal\"); git tag --merged | grep -Fqx \"$name-$version\" || git tag -f -s -m \"$name v$version\" $name-$version; done"''; alias.cl = "notes --ref=changelog append"; alias.cl-bug = "notes --ref=changelogs/bugs append"; alias.cl-feature = "notes --ref=changelogs/features append"; alias.wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads"; diff.algorithm = "histogram"; diff.sqldiff.command = "sqldiff"; format.pretty = "oneline"; web.browser = "elinks"; browser.elinks.cmd = "elinks"; sendemail.chainreplyto = "false"; sendemail.composeencoding = "UTF-8"; sendemail.confirm = "always"; sendemail.envelopesender = "auto"; sendemail.multiedit = "yes"; sendemail.suppressfrom = "false"; sendemail.thread = "true"; sendemail.validate = "true"; merge.tool = "vimdiff"; protocol.version = 2; rebase.autosquash = "true"; }; }; }