X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=states%2Fgit%2Finit.sls;h=4e2764a97c52869c9e1fc8aec031003d29bd22f2;hb=2e0416f4fef277be2daded25c84d58ac4027a64d;hp=b1dc69ef37472ad6401a8f4de487db703c027e27;hpb=9da99176cb93e27da861bb0bbef089fb5de31590;p=max%2Fsaltfiles.git diff --git a/states/git/init.sls b/states/git/init.sls index b1dc69e..4e2764a 100644 --- a/states/git/init.sls +++ b/states/git/init.sls @@ -2,16 +2,47 @@ include: - git.{{ grains['os'] | lower }} -{% set git_vars = { +{% set git_confs = { + 'color.ui': 'true', + 'color.branch': 'always', + 'color.status': 'always', + 'color.interactive': 'always', + 'color.diff': 'true', 'user.name': 'Maximilian Friedersdorff', - 'user.email': 'max@friedersdorff.com' + 'user.email': 'max@friedersdorff.com', + 'user.signingkey': 'F5E7FCB3', + 'core.editor': 'vim', + 'core.excludesfile': '/home/' + grains['user'] + '/.gitignore', + 'merge.tool': 'diffuse', + 'merge.ff': 'true', + 'push.default': 'simple', + 'alias.lg': 'lg = log --graph --pretty=format:\'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset\' --date=short', + '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', + 'alias.struct': 'struct = log --graph --full-history --all --pretty=format:\'%ad %s %Creset %C(yellow)%d%Creset\' --date=short --simplify-by-decoration', + 'alias.co': 'checkout', + 'alias.ci': 'commit -S', + 'alias.commit': 'commit -S', + 'alias.st': 'status', + 'alias.vh': 'verify-commit HEAD', + 'alias.vc': 'verify-commit', + 'alias.vt': 'tag -v', + 'alias.tag': 'tag -s', + 'alias.t': 'tag -s', } %} -{% for var,val in git_vars.items() %} +{% for var,val in git_confs.items() %} {{ var }}: git.config_set: - value: {{ val }} - global: True - user: {{ grains['user'] }} {% endfor %} + +global gitignore: + file.managed: + - name: {{ grains['homedir'] }}/.gitignore + - source: {{ grains['stateroot'] }}/git/files/gitignore + - mode: 644 + - user: {{ grains['user'] }} + - group: {{ grains['user'] }}