19 ignores = [ "*~" "*.swp" ];
20 package = lib.mkDefault pkgs.gitMinimal;
27 authors = "shortlog -s -n";
29 bl = "git log -p -M --follow --stat --";
31 ca = "commit --amend";
32 caa = "commit --amend -C@";
33 caaa = "commit --amend -C@ -a";
34 cf = "commit --fixup";
38 dcw = "diff --cached --word-diff=color";
39 dh = "diff --histogram";
40 dp = "diff --patience";
41 dt = "difftool --patience";
42 dtc = "difftool --cached";
43 dw = "diff --word-diff=color";
45 ign = "ls-files -o -i --exclude-standard";
47 ll = "log --graph --decorate --pretty=oneline --abbrev-commit";
48 lp = "log -p --pretty=fuller";
49 lpg = "log -p --pretty=fuller -g";
58 spull = "!git-svn fetch && git-svn rebase";
59 spush = "!git-svn dcommit";
63 fetch-local = "!git fetch local && git tag -d $(git describe --exact-match 2>/dev/null >/dev/null) && git fetch --tags local";
64 pull-local = "!git fetch-local && git checkout -B master local/master";
65 pull-local-old = "!git fetch-local && git checkout HEAD'^' && git branch -f master local/master && git checkout master";
66 root = ''!git rev-list --parents HEAD | egrep "^[a-f0-9]{40}$"'';
67 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]\\(\\^{}\\)\\?\"'';
68 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"'';
69 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]\\(\\^{}\\)\\?\"'';
70 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"'';
71 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"'';
72 cl = "notes --ref=changelog append";
73 cl-bug = "notes --ref=changelogs/bugs append";
74 cl-feature = "notes --ref=changelogs/features append";
75 wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads";
78 browser.elinks.cmd = "elinks";
79 color.branch = "auto";
81 #color.diff.whitespace = "red reverse";
82 color.status = "auto";
83 core.commentChar = "auto";
84 core.quotepath = "false";
85 core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
86 diff.algorithm = "histogram";
87 diff.sqldiff.command = "sqldiff";
88 format.pretty = "oneline";
89 gui.fontdiff = ''-family "DejaVu Sans Mono" -size 8 -weight normal -slant roman -underline 0 -overstrike 0'';
90 gui.fontui = ''-family "DejaVu Sans" -size 8 -weight normal -slant roman -underline 0 -overstrike 0'';
91 gui.spellingdictionary = "en_US";
93 guitool."Rebase interactive" = {
94 cmd = "EDITOR=gvim git rebase -i $REVISION";
97 init.defaultBranch = "main";
98 merge.tool = "vimdiff";
101 push.default = "simple";
102 rebase.autosquash = "true";
103 sendemail.chainReplyTo = "false";
104 sendemail.composeencoding = "UTF-8";
105 sendemail.confirm = "always";
106 sendemail.envelopeSender = "auto";
107 sendemail.multiedit = "yes";
108 sendemail.suppressFrom = "false";
109 sendemail.suppresscc = "self";
110 sendemail.thread = "true";
111 sendemail.validate = "true";
112 web.browser = "elinks";
116 diff.external = lib.concatStringsSep " " [
117 "${pkgs.difftastic}/bin/difft"
120 "--display side-by-side"
125 diff.tool = "difftastic";
126 difftool.prompt = false;
127 difftool.difftastic.cmd = ''${pkgs.difftastic}/bin/difft "$LOCAL" "$REMOTE"'';
128 pager.difftool = true;
133 core.pager = "delta";
134 interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only --features=interactive";
135 delta.features = "decorations";
136 delta.interactive = {
137 keep-plus-minus-markers = false;
139 delta.decorations = {
140 commit-decoration-style = "blue ol";
141 commit-style = "raw";
143 hunk-header-decoration-style = "blue box";
144 hunk-header-file-style = "red";
145 hunk-header-line-number-style = "#067a00";
146 hunk-header-style = "file line-number syntax";
154 ge = "git-edit-commit";
156 gge = "git-grep-edit";
160 git-edit-commit () { $EDITOR $(git diff-tree --no-commit-id --name-only -r "$@"); }
161 git-grep-edit () { $EDITOR $(git grep --name-only --recursive "$@"); }