mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
improved context system
This commit is contained in:
28
playbooks/roles/software_git/templates/gitconfig.context.j2
Normal file
28
playbooks/roles/software_git/templates/gitconfig.context.j2
Normal file
@@ -0,0 +1,28 @@
|
||||
[user]
|
||||
email = {{ git.email }}
|
||||
name = {{ git.name }}
|
||||
{% if 'signing_key' in git %}
|
||||
signingkey = {{ git.signing_key }}
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[gpg "ssh"]
|
||||
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
|
||||
{% endif %}
|
||||
|
||||
{% if 'replacements' in git %}
|
||||
{% for replacement in git.replacements %}
|
||||
|
||||
[url "{{ replacement.use }}"]
|
||||
insteadOf = "{{ replacement.instead_of }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
[url "git@github-{{name}}:"]
|
||||
insteadOf = https://github.com/
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[gpg "ssh"]
|
||||
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
|
||||
|
||||
[alias]
|
||||
graph = log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%C(blue)%x20(%ce)%x20%C(cyan)[gpg:%GK%x20%G?]%C(reset)%n%x20%s%n"
|
||||
@@ -20,8 +15,6 @@
|
||||
|
||||
[difftool "nvimdiff"]
|
||||
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[url "https://"]
|
||||
insteadOf = git://
|
||||
|
||||
@@ -43,11 +36,13 @@
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[includeIf "gitdir:~/Projects/zeronorth/"]
|
||||
path = ~/Projects/zeronorth/.gitconfig
|
||||
|
||||
[includeIf "gitdir:~/Projects/private/"]
|
||||
path = ~/Projects/private/.gitconfig
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
|
||||
{% for key in contexts %}
|
||||
{% if 'git' in contexts[key] %}
|
||||
[includeIf "gitdir:{{ contexts[key].path }}/"]
|
||||
path = {{ contexts[key].path }}/.gitconfig
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
host github-{{ name }}
|
||||
hostname ssh.github.com
|
||||
user git
|
||||
port 443
|
||||
IdentityFile ~/.ssh/keys/github-{{ name }}.pub
|
||||
IdentitiesOnly yes
|
||||
Reference in New Issue
Block a user