]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/git/init.sls
Implement remaining git config options
[max/saltfiles.git] / states / git / init.sls
1 include:
2   - git.{{ grains['os'] | lower }}
3
4
5 {% set git_vars = {
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',
24   'alias.st': 'status',
25 }
26 %}
27
28 {% for var,val in git_vars.items() %}
29 {{ var }}:
30   git.config_set:
31     - value: {{ val }}
32     - global: True
33     - user: {{ grains['user'] }}
34 {% endfor %}