]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/git/init.sls
Use difftastic for diffs
[max/saltfiles.git] / states / git / init.sls
1 include:
2   - git.{{ grains['os'] | lower }}
3
4
5 {% set git_confs = {
6   'color.ui': 'true',
7   'color.branch': 'always',
8   'color.status': 'always',
9   'color.interactive': 'always',
10   'color.diff': 'true',
11   'diff.external': 'difft',
12   'user.name': 'Maximilian Friedersdorff',
13   'user.email': 'max@friedersdorff.com',
14   'user.signingkey': 'F5E7FCB3',
15   'core.editor': 'vim',
16   'core.excludesfile': '/home/' + grains['user'] + '/.gitignore',
17   'merge.tool': 'diffuse',
18   'merge.ff': 'true',
19   'pull.rebase': 'false',
20   'push.default': 'simple',
21   'alias.lg': 'log --graph --pretty=format:\'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset\' --date=short',
22   'alias.hist': 'log --graph --full-history --all --pretty=format:\'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset\' --date=short',
23   'alias.struct': 'log --graph --full-history --all --pretty=format:\'%ad %s %Creset %C(yellow)%d%Creset\' --date=short --simplify-by-decoration',
24   'alias.co': 'checkout',
25   'alias.ci': 'commit',
26   'alias.st': 'status',
27   'alias.vh': 'verify-commit HEAD',
28   'alias.vc': 'verify-commit',
29   'alias.vt': 'tag -v',
30   'alias.tag': 'tag -s',
31   'alias.t': 'tag -s',
32   'alias.alias': '!req=$\'\\033[0;31m=\\033[0m\'; git config --get-regexp ^alias\. | sed -e s/^alias\.// -e "s/\ /\t$req\ /"',
33   'alias.r': 'rebase',
34   'alias.m': 'merge',
35   'alias.pa': '!git remote | xargs -L1 git push --all',
36 }
37 %}
38
39 {% for var,val in git_confs.items() %}
40 {{ var }}:
41   git.config_set:
42     - value: >-
43         {{ val }}
44     - global: True
45     - user: {{ grains['user'] }}
46 {% endfor %}
47
48 global gitignore:
49   file.managed:
50     - name: {{ grains['homedir'] }}/.gitignore
51     - source: {{ grains['stateroot'] }}/git/files/gitignore
52     - mode: 644
53     - user: {{ grains['user'] }}
54     - group: {{ grains['user'] }}