From b7be1ac6583f10a8ddb7658094285bb10cb6b428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Grondek?= Date: Thu, 28 Nov 2019 11:02:40 +0100 Subject: [PATCH] [git] add git config --- Makefile | 2 +- git/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ git/config | 6 ++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 git/Makefile create mode 100644 git/config diff --git a/Makefile b/Makefile index f711d02..09ccdf6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ SERVER_PARTS=bash ssh vim docker terraform -CLIENT_PARTS=i3 packages +CLIENT_PARTS=i3 packages git .PHONY: clean_install diff --git a/git/Makefile b/git/Makefile new file mode 100644 index 0000000..cc87e29 --- /dev/null +++ b/git/Makefile @@ -0,0 +1,40 @@ +GIT_BIN=/usr/bin/git +PACKAGE=git + +GIT_CONFIG=config +GIT_CONFIG_OUT=$(HOME)/.config/git/config +GIT_GLOBAL_CONFIG=$(HOME)/.gitconfig +CONFIG_DIR=$(HOME)/.config/git + +ROOT_APT=sudo aptitude + +OUT=$(GIT_CONFIG_OUT) + +.PHONY: clean_install + +clean_install: clean install +install: $(GIT_BIN) config +clean: clean_config clean_package + +$(GIT_BIN): + $(ROOT_APT) install $(PACKAGE) + +.ONESHELL: +config: $(CONFIG_DIR) $(GIT_BIN) +ifeq ("$(wildcard $(GIT_GLOBAL_CONFIG))","") + rm -f $(GIT_CONFIG_OUT) + echo "Please provide email address for git" + read EMAIL + git config --global user.email $${EMAIL} +endif + cp $(GIT_CONFIG) $(GIT_CONFIG_OUT) + +$(CONFIG_DIR): + mkdir -p $(CONFIG_DIR) + +clean_package: + $(ROOT_APT) purge $(PACKAGE) + +clean_config: + rm -f $(GIT_CONFIG_OUT) + diff --git a/git/config b/git/config new file mode 100644 index 0000000..60e2818 --- /dev/null +++ b/git/config @@ -0,0 +1,6 @@ +[user] + name = Przemysław Grondek +[help] + autocorrect = 1 +[remotes] + prune = true