From 3b689f03de755f6a241f9c042270c0d7e579a657 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 5 Mar 2020 14:06:14 +0000 Subject: [PATCH] Support gitconfig with home-manager - Migrate configuration from .gitconfig to home-manager. - Delete .gitconfig. - Delete .gitignore because I'm not using OSX anymore. --- configs/shared/.config/nixpkgs/home.nix | 21 ++++++++++++++++++++ configs/shared/.gitconfig | 26 ------------------------- configs/shared/.gitignore | 2 -- 3 files changed, 21 insertions(+), 28 deletions(-) delete mode 100644 configs/shared/.gitconfig delete mode 100644 configs/shared/.gitignore diff --git a/configs/shared/.config/nixpkgs/home.nix b/configs/shared/.config/nixpkgs/home.nix index 8307d6b86..29e80824e 100644 --- a/configs/shared/.config/nixpkgs/home.nix +++ b/configs/shared/.config/nixpkgs/home.nix @@ -15,6 +15,27 @@ path = builtins.toPath ~/home-manager; }; + programs.git = { + enable = true; + userName = "William Carroll"; + userEmail = "wpcarro@gmail.com"; + aliases = { + today = "! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\""; + yday = "! git log --since=yesterday.midnight --until=today.midnight --oneline --author=\"$(git config --get user.email)\""; + changed-files = "! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master)"; + conflicts = "! git --no-pager diff --name-only --diff-filter=U"; + unstage = "reset HEAD --"; + }; + extraConfig = { + push.default = "current"; + rebase = { + autosquash = true; + autostash = true; + }; + rerere.enabled = true; + }; + }; + ############################################################################## # Services ############################################################################## diff --git a/configs/shared/.gitconfig b/configs/shared/.gitconfig deleted file mode 100644 index 4aa8e82d7..000000000 --- a/configs/shared/.gitconfig +++ /dev/null @@ -1,26 +0,0 @@ -[user] - name = William Carroll - email = wpcarro@gmail.com -[alias] - recent = ! git for-each-ref --count=10 --sort=-committerdate refs/heads/ --format=\"%(refname:short)\" | fzf | xargs git checkout - today = ! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\" - changed-files = ! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master) - conflicts = ! git --no-pager diff --name-only --diff-filter=U - yday = ! git log --since=yesterday.midnight --until=today.midnight --oneline --author=\"$(git config --get user.email)\" - patch-grep = log -p -S - unstage = reset HEAD -- - appraise = ! $HOME/go/bin/git-appraise -[push] - default = current -[rebase] - autosquash = true - autostash = true -[remote "origin"] - fetch = +refs/pull/*/head:refs/remotes/origin/pr/* -[github] - user = wpcarro -[core] - excludesfile = ~/.gitignore - pager = less -[rerere] - enabled = true diff --git a/configs/shared/.gitignore b/configs/shared/.gitignore deleted file mode 100644 index 0d9002511..000000000 --- a/configs/shared/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Mac -.DS_Store