From 5f99af32cfe52fd35627c1726dd33a513d57f5f5 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sun, 1 Oct 2023 11:48:13 +0200 Subject: [PATCH] feat(git): add git-delta Signed-off-by: Matej Focko --- roles/user/git/tasks/install.yml | 9 +++++++++ roles/user/git/tasks/main.yml | 4 ++++ roles/user/git/templates/gitconfig | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 roles/user/git/tasks/install.yml diff --git a/roles/user/git/tasks/install.yml b/roles/user/git/tasks/install.yml new file mode 100644 index 0000000..83addc2 --- /dev/null +++ b/roles/user/git/tasks/install.yml @@ -0,0 +1,9 @@ +--- +# TODO: Resolve the issues with EL +- name: Install the required packages + ansible.builtin.package: + name: + - git + - git-delta + state: present + become: true diff --git a/roles/user/git/tasks/main.yml b/roles/user/git/tasks/main.yml index 104fd3b..8bf9765 100644 --- a/roles/user/git/tasks/main.yml +++ b/roles/user/git/tasks/main.yml @@ -1,4 +1,8 @@ --- +- name: Packages + ansible.builtin.include_tasks: install.yml + tags: install + - name: Create git config ansible.builtin.template: src: templates/gitconfig diff --git a/roles/user/git/templates/gitconfig b/roles/user/git/templates/gitconfig index 590295d..d8c6ed8 100644 --- a/roles/user/git/templates/gitconfig +++ b/roles/user/git/templates/gitconfig @@ -8,6 +8,22 @@ [core] editor = code --wait excludesfile = /home/{{ target_user }}/.gitignore + pager = delta + +[delta] + file-style = blue bold + # file-decoration-style = omit + hunk-header-style = omit + hunk-header-decoration-style = omit + # minus-emph-style = normal "#701011" + # plus-emph-style = syntax "#105010" + + line-numbers = true + hyperlinks = true + # hyperlinks-file-link-format = "vscode://file/{path}:{line}" + # side-by-side = true + navigate = true + features = decorations [diff] tool = vscode-difftool