]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/git/init.sls
Add 'changes' alias
[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': 'false',
18   'pull.rebase': 'true',
19   'pull.ff': 'true',
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.pa': '!git remote | xargs -L1 git push --all',
34   'alias.fi': 'flow feature finish --push --no-ff',
35   'alias.changes': '!git log $(git tag -l --sort=taggerdate | tail -n 1)..HEAD --pretty=format:"* %s" --no-merges --reverse',
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 {% if grains['host'] in ["barium", "baryte"] %}
53 work_email:
54   git.config_set:
55     - name: user.email
56     - value: >-
57         maximilian.friedersdorff@envsys.co.uk
58     - global: True
59     - user: {{ grains['user'] }}
60
61 work_gpg:
62   git.config_set:
63     - name: user.signingkey
64     - value: >-
65         B3030EB2
66     - global: True
67     - user: {{ grains['user'] }}
68 {% endif %}
69
70 global gitignore:
71   file.managed:
72     - name: {{ grains['homedir'] }}/.gitignore
73     - source: {{ grains['stateroot'] }}/git/files/gitignore
74     - mode: 644
75     - user: {{ grains['user'] }}
76     - group: {{ grains['user'] }}
77
78 git-prompt:
79   file.managed:
80     - name: {{ grains['homedir'] }}/.git-prompt.sh
81     - source: https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
82     - mode: 644
83     - user: {{ grains['user'] }}
84     - group: {{ grains['user'] }}
85     - skip_verify: True
86
87