]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/git/init.sls
4e2764a97c52869c9e1fc8aec031003d29bd22f2
[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   'user.name': 'Maximilian Friedersdorff',
12   'user.email': 'max@friedersdorff.com',
13   'user.signingkey': 'F5E7FCB3',
14   'core.editor': 'vim',
15   'core.excludesfile': '/home/' + grains['user'] + '/.gitignore',
16   'merge.tool': 'diffuse',
17   'merge.ff': 'true',
18   'push.default': 'simple',
19   'alias.lg': 'lg = log --graph --pretty=format:\'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset\' --date=short',
20   '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',
21   'alias.struct': 'struct = log --graph --full-history --all --pretty=format:\'%ad %s %Creset %C(yellow)%d%Creset\' --date=short --simplify-by-decoration',
22   'alias.co': 'checkout',
23   'alias.ci': 'commit -S',
24   'alias.commit': 'commit -S',
25   'alias.st': 'status',
26   'alias.vh': 'verify-commit HEAD',
27   'alias.vc': 'verify-commit',
28   'alias.vt': 'tag -v',
29   'alias.tag': 'tag -s',
30   'alias.t': 'tag -s',
31 }
32 %}
33
34 {% for var,val in git_confs.items() %}
35 {{ var }}:
36   git.config_set:
37     - value: {{ val }}
38     - global: True
39     - user: {{ grains['user'] }}
40 {% endfor %}
41
42 global gitignore:
43   file.managed:
44     - name: {{ grains['homedir'] }}/.gitignore
45     - source: {{ grains['stateroot'] }}/git/files/gitignore
46     - mode: 644
47     - user: {{ grains['user'] }}
48     - group: {{ grains['user'] }}