Copy the .gitconfig file directly

Trying to be smart and using the git_config module was breaking aliases
and other settings, because of stray quotation marks.
This commit is contained in:
Anthony Rose 2021-03-09 22:00:05 +00:00
parent 219d8e99db
commit 842d69a591
4 changed files with 29 additions and 106 deletions

View file

@ -0,0 +1,25 @@
[pull]
rebase = true
[push]
default = simple
[color]
ui = auto
[credential]
helper = store
[gui]
encoding = utf-8
[guitool "Rebase"]
cmd = rebase
[user]
name = Anthony Perkins
email = anthony@acperkins.com
[alias]
ci = commit
co = checkout
ff = merge --ff-only
graph = log --graph --oneline --all
l1 = log --pretty=oneline
last = log -1 HEAD --pretty=fuller
lastmail = format-patch --stdout -1 HEAD
unstage = reset HEAD --
up = pull --rebase

View file

@ -37,3 +37,7 @@
ansible.builtin.copy: ansible.builtin.copy:
src: mailcap src: mailcap
dest: "{{ ansible_env.HOME }}/.mailcap" dest: "{{ ansible_env.HOME }}/.mailcap"
- name: Copy .gitconfig
ansible.builtin.copy:
src: gitconfig
dest: "{{ ansible_env.HOME }}/.gitconfig"

View file

@ -1,105 +0,0 @@
---
# Copyright 2021 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Git pull.rebase
community.general.git_config:
name: pull.rebase
value: 'true'
scope: global
- name: Git push.default
community.general.git_config:
name: push.default
value: simple
scope: global
- name: Git color.ui
community.general.git_config:
name: color.ui
value: auto
scope: global
- name: Git credential.helper
community.general.git_config:
name: credential.helper
value: store
scope: global
- name: Git gui.encoding
community.general.git_config:
name: gui.encoding
value: utf-8
scope: global
- name: Git guitool.Rebase.cmd
community.general.git_config:
name: guitool.Rebase.cmd
value: rebase
scope: global
- name: Git user.name
community.general.git_config:
name: user.name
value: Anthony Perkins
scope: global
- name: Git user.email
community.general.git_config:
name: user.email
value: anthony@acperkins.com
scope: global
- name: Git alias.ci
community.general.git_config:
name: alias.ci
value: commit
scope: global
- name: Git alias.co
community.general.git_config:
name: alias.co
value: checkout
scope: global
- name: Git alias.ff
community.general.git_config:
name: alias.ff
value: merge --ff-only
scope: global
- name: Git alias.graph
community.general.git_config:
name: alias.graph
value: log --graph --oneline --all
scope: global
- name: Git alias.l1
community.general.git_config:
name: alias.l1
value: log --pretty=oneline
scope: global
- name: Git alias.last
community.general.git_config:
name: alias.last
value: log -1 HEAD --pretty=fuller
scope: global
- name: Git alias.lastmail
community.general.git_config:
name: alias.lastmail
value: format-patch --stdout -1 HEAD
scope: global
- name: Git alias.unstage
community.general.git_config:
name: alias.unstage
value: reset HEAD --
scope: global
- name: Git alias.up
community.general.git_config:
name: alias.up
value: pull --rebase
scope: global
- name: Git URL rewrite
community.general.git_config:
name: url."https://code.acperkins.com/".insteadof
value: https://git.acperkins.com/
scope: global

View file

@ -17,6 +17,5 @@
- include: dotfiles.yml - include: dotfiles.yml
- include: shell.yml - include: shell.yml
- include: gitconfig.yml
- include: vim.yml - include: vim.yml
- include: ssh-authorized-keys.yml - include: ssh-authorized-keys.yml