From 08721fbe713d6e327df07e31f13ddea9055dc1c5 Mon Sep 17 00:00:00 2001 From: Stefan Gaiselmann Date: Sat, 13 Feb 2021 10:40:12 +0100 Subject: [PATCH] Added p4merge as mergetool in git config (only if OS is windows). --- dot_gitconfig.tmpl | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/dot_gitconfig.tmpl b/dot_gitconfig.tmpl index 87deb7a..803a817 100644 --- a/dot_gitconfig.tmpl +++ b/dot_gitconfig.tmpl @@ -14,17 +14,17 @@ ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]%Creset%Cgreen\\ (%cd)" --decorate --numstat --date=relative ld = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative - + # Short summary of commiters summary = shortlog --summary --numbered --email - + # https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit # list remote branches ordered by date - rr = for-each-ref --sort=-committerdate refs/remotes/ --count=20 --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))' + rr = for-each-ref --sort=-committerdate refs/remotes/ --count=20 --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))' # show tracked files ls-tracked = ls-tree -r --name-only HEAD - + # show number of commits per author # https://stackoverflow.com/questions/9839083/git-number-of-commits-per-author-on-all-branches stats = shortlog -s -n --all --no-merges @@ -45,26 +45,44 @@ ss = status -s --branch -uno co = checkout pr = remote prune origin - + # from pixelbeat brdate = for-each-ref --sort=-committerdate --format='%(committerdate:iso8601) %(refname:short)' refs/heads/ - st = stash list --date=local - alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ / - d = diff -w - dc = diff -w --cached + st = stash list --date=local + alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ / + d = diff -w + dc = diff -w --cached # from https://www.toptal.com/developers/gitignore # create .gitignore templates based on operationg systems, IDE, languages etc. ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi" - + [core] - editor = vim + editor = vim [push] # default = matching default = simple # safer option, push only current branch +[pull] + ff = only + +{{ if eq .chezmoi.os "windows" -}} [merge] tool = p4merge - ff = false -[pull] - ff = only + ff = false + +[mergetool "p4merge"] + path = "C:\\Program Files\\Perforce\\p4merge.exe" + cmd = p4merge $BASE $LOCAL $REMOTE $MERGED + keepBackup = false + +[difftool "p4merge"] + external = p4merge $LOCAL $REMOTE + +[difftool "winmerge"] + cmd = "'c:/PortableApps/PortableApps/WinMergePortable/App/WinMerge/WinMergeU'" -e "$LOCAL" "$REMOTE" + +{{ end -}} + +[http] + # proxy = http://host:port