]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/git.nix
oignon: firewall: open tcp/8000 over wg-intra
[julm/julm-nix.git] / home-manager / profiles / git.nix
1 { pkgs, lib, config, ... }:
2 {
3 home.packages = [
4 pkgs.git-chglog
5 pkgs.git-crypt
6 pkgs.git-quick-stats
7 ];
8 programs.git = {
9 enable = true;
10 ignores = [ "*~" "*.swp" ];
11 package = pkgs.gitFull;
12 aliases = {
13 authors = "shortlog -s -n";
14 bl = "git log -p -M --follow --stat --";
15 b = "branch";
16 c = "commit";
17 ca = "commit --amend -C@";
18 cf = "commit --fixup";
19 co = "checkout";
20 d = "diff";
21 dc = "diff --cached";
22 dh = "diff --histogram";
23 dp = "diff --patience";
24 ign = "ls-files -o -i --exclude-standard";
25 ll = "log --graph --decorate --pretty=oneline --abbrev-commit";
26 lp = "log -p";
27 s = "status";
28 spull = "!git-svn fetch && git-svn rebase";
29 spush = "!git-svn dcommit";
30 ss = "status -s";
31 st = "status -uno";
32 sw = "switch";
33 fetch-local = "!git fetch local && git tag -d $(git describe --exact-match 2>/dev/null >/dev/null) && git fetch --tags local";
34 pull-local = "!git fetch-local && git checkout -B master local/master";
35 pull-local-old = "!git fetch-local && git checkout HEAD'^' && git branch -f master local/master && git checkout master";
36 root = ''!git rev-list --parents HEAD | egrep "^[a-f0-9]{40}$"'';
37 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]\\(\\^{}\\)\\?\"'';
38 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"'';
39 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]\\(\\^{}\\)\\?\"'';
40 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"'';
41 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"'';
42 cl = "notes --ref=changelog append";
43 cl-bug = "notes --ref=changelogs/bugs append";
44 cl-feature = "notes --ref=changelogs/features append";
45 wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads";
46 };
47 extraConfig = {
48 push.default = "simple";
49 color.diff = "auto";
50 #color.diff.whitespace = "red reverse";
51 color.status = "auto";
52 color.branch = "auto";
53 core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
54 core.quotepath = "false";
55 diff.algorithm = "histogram";
56 diff.sqldiff.command = "sqldiff";
57 format.pretty = "oneline";
58 init.defaultBranch = "main";
59 web.browser = "elinks";
60 browser.elinks.cmd = "elinks";
61 sendemail.chainReplyTo = "false";
62 sendemail.composeencoding = "UTF-8";
63 sendemail.confirm = "always";
64 sendemail.envelopeSender = "auto";
65 sendemail.multiedit = "yes";
66 sendemail.suppresscc = "self";
67 sendemail.suppressFrom = "false";
68 sendemail.thread = "true";
69 sendemail.validate = "true";
70 merge.tool = "vimdiff";
71 protocol.version = 2;
72 pull.rebase = true;
73 rebase.autosquash = "true";
74 };
75 };
76 }