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