]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/git/init.sls
Configure git send-email
[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   'sendemail.smtpserver': 'mail.friedersdorff.com',
37   'sendemail.smtpuser': 'max',
38   'sendemail.smtpencryption': 'tls',
39   'sendemail.smtpserverport': '587',
40 }
41 %}
42
43 {% for var,val in git_confs.items() %}
44 {{ var }}:
45   git.config_set:
46     - value: >-
47         {{ val }}
48     - global: True
49     - user: {{ grains['user'] }}
50 {% endfor %}
51
52 global gitignore:
53   file.managed:
54     - name: {{ grains['homedir'] }}/.gitignore
55     - source: {{ grains['stateroot'] }}/git/files/gitignore
56     - mode: 644
57     - user: {{ grains['user'] }}
58     - group: {{ grains['user'] }}