]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/git/init.sls
9d03b7d686b03545c04ed876a1765219c58d836d
[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   'pull.rebase': 'false',
19   'push.default': 'simple',
20   'alias.lg': 'log --graph --pretty=format:\'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset\' --date=short',
21   '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',
22   'alias.struct': 'log --graph --full-history --all --pretty=format:\'%ad %s %Creset %C(yellow)%d%Creset\' --date=short --simplify-by-decoration',
23   'alias.co': 'checkout',
24   'alias.ci': 'commit',
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   'alias.alias': '!req=$\'\\033[0;31m=\\033[0m\'; git config --get-regexp ^alias\. | sed -e s/^alias\.// -e "s/\ /\t$req\ /"',
32   'alias.r': 'rebase',
33   'alias.m': 'merge',
34   'alias.pa': '!git remote | xargs -L1 git push --all',
35 }
36 %}
37
38 {% for var,val in git_confs.items() %}
39 {{ var }}:
40   git.config_set:
41     - value: >-
42         {{ val }}
43     - global: True
44     - user: {{ grains['user'] }}
45 {% endfor %}
46
47 global gitignore:
48   file.managed:
49     - name: {{ grains['homedir'] }}/.gitignore
50     - source: {{ grains['stateroot'] }}/git/files/gitignore
51     - mode: 644
52     - user: {{ grains['user'] }}
53     - group: {{ grains['user'] }}