From 8ebef9fbb4c0eb5e98a1ed185a4f3263a30953d5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 4 Jul 2016 16:08:43 +1200 Subject: Template .gitconfig personal values Doing this in preference to relying on GIT_* environment variables. I don't like the default values in the Makefile very much; I'll need to figure out something nicer at some point. --- .gitignore | 1 + Makefile | 16 ++++++++++++++-- git/gitconfig | 39 --------------------------------------- git/gitconfig.m4 | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 41 deletions(-) delete mode 100644 git/gitconfig create mode 100644 git/gitconfig.m4 diff --git a/.gitignore b/.gitignore index 5575cf5a..b5b1bf83 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +git/gitconfig gnupg/gpg.conf man/man7/dotfiles.7 tmux/tmux.conf diff --git a/Makefile b/Makefile index f55b04f1..bc545823 100644 --- a/Makefile +++ b/Makefile @@ -53,14 +53,26 @@ lint-sh \ lint-urxvt -all : gnupg/gpg.conf +NAME := Tom Ryder +EMAIL := tom@sanctum.geek.nz +KEY := 0xC14286EA77BB8872 + +all : git/gitconfig gnupg/gpg.conf clean distclean : rm -f \ + git/gitconfig \ gnupg/gpg.conf \ man/man7/dotfiles.7 \ tmux/tmux.conf +git/gitconfig : git/gitconfig.m4 + m4 \ + -D DOTFILES_NAME="$(NAME)" \ + -D DOTFILES_EMAIL="$(EMAIL)" \ + -D DOTFILES_KEY="$(KEY)" \ + git/gitconfig.m4 > git/gitconfig + gnupg/gpg.conf : gnupg/gpg.conf.m4 m4 -D DOTFILES_HOME="$(HOME)" \ gnupg/gpg.conf.m4 > gnupg/gpg.conf @@ -140,7 +152,7 @@ install-games-man : install -m 0755 -d -- "$(HOME)"/.local/share/man/man6 install -pm 0644 -- man/man6/*.6 "$(HOME)"/.local/share/man/man6 -install-git : +install-git : git/gitconfig install -pm 0644 -- git/gitconfig "$(HOME)"/.gitconfig install-gnupg : gnupg/gpg.conf diff --git a/git/gitconfig b/git/gitconfig deleted file mode 100644 index 5fbe38c4..00000000 --- a/git/gitconfig +++ /dev/null @@ -1,39 +0,0 @@ -# -# The user section is intentionally left undefined here, because the name and -# email I want to use for commits varies between contexts and machines (most -# notably when I'm on a work machine). I therefore use an un-versioned script -# in ~/.profile.d to do this that looks something like the following: -# -# GIT_AUTHOR_NAME='Tom Ryder' -# GIT_AUTHOR_EMAIL='tom@sanctum.geek.nz' -# GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME -# GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL -# export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL -# -[advice] - statusHints = false - -[alias] - others = ls-files --others --exclude-standard - -[color] - ui = true - -[diff] - tool = vimdiff - -[difftool] - prompt = false - -[grep] - extendRegexp = true - lineNumber = true - -[log] - date = local - -[push] - default = matching - -[status] - short = true diff --git a/git/gitconfig.m4 b/git/gitconfig.m4 new file mode 100644 index 00000000..0397cb93 --- /dev/null +++ b/git/gitconfig.m4 @@ -0,0 +1,32 @@ +[advice] + statusHints = false + +[alias] + others = ls-files --others --exclude-standard + +[color] + ui = true + +[diff] + tool = vimdiff + +[difftool] + prompt = false + +[grep] + extendRegexp = true + lineNumber = true + +[log] + date = local + +[push] + default = matching + +[status] + short = true + +[user] + name = Tom Ryder + email = tom@sanctum.geek.nz + signingKey = 0xC14286EA77BB8872 -- cgit v1.2.3