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