summaryrefslogtreecommitdiffstats
path: root/.gitconfig
blob: cbe1a900ac3e537c6d75c274605510339fa62e11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[user]
	name = Jan Pokorný
	email = jpokorny@redhat.com

[alias]
	ai = add -ip
	c = commit -s
	ci = "!git_ci() {\
	git checkout-index --temp -- \"${@/#/$GIT_PREFIX}\"\
	| xargs -I {} sh -c '_do() {\
	  mv \"$1\" \"${GIT_PREFIX}.checkout-$(basename \"$2\")\";\
	  }; _do {}';\
	}; git_ci"
	co = checkout
	g = log --grep
	gg = log -p --grep
	cw = diff --color-words=[^[:space:],_]+
	dh = diff HEAD
	ds = diff --staged
	rh = reset HEAD
	wd = diff --word-diff
	swd = show --word-diff
	su = "!git_su() {\
	set -- $(git rev-list --left-right --count @{u}...HEAD);\
	test $2 -eq 0 || git show -$2;\
	test $1 -eq 0 || echo \"also $1 behind!\";\
	}; git_su"
	pd = "!git_pd() {\
	git diff --color \"$@\" | subdiff | ${GIT_PAGER:-${PAGER:-less}};\
	}; git_pd"
	pwd = "!git_pwd() {\
	git wd --color \"$@\" | subdiff | ${GIT_PAGER:-${PAGER:-less}};\
	}; git_pwd"
	ps = "!git_ps() {\
	git show --color \"$@\" | subdiff | ${GIT_PAGER:-${PAGER:-less}};\
	}; git_ps"
	pswd = "!git_pswd() {\
	git swd --color \"$@\" | subdiff | ${GIT_PAGER:-${PAGER:-less}};\
	}; git_pswd"
	# script to preserve colors; quoting is strange, but "just works"
	s = "!git_s() {\
	script -qc \"git status \"$@\"\" /dev/null\
	| grep -ve '^.   [(]' -e '^..$'\
	| awk '/^[\"-$] Untracked/{exit}{print $0}';\
	}; git_s"
	sb = show-branch
	# git se @<project name or another optional tag> ....
	se = "!git_se() {\
	local subjpfx=\"PATCH\"; [[ $1 =~ ^@* ]] && [[ ${@:$#} =~ ^-[1-9]* ]]\
	  && subjpfx=\"${1#@}][${subjpfx}\" && shift && echo \"SUBJ prefix: [${subjpfx}]\";\
	git send-email --subject-prefix=\"${subjpfx}\" \"$@\";\
	}; git_se"
	wc = whatchanged
	pwc = "!git_pwc() {\
	git wc --color \"$@\" | subwc | ${GIT_PAGER:-${PAGER:-less}};\
	}; git_pwc"
	# http://www.jukie.net/bart/blog/pimping-out-git-log
	lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset %Cred[%G?]%Creset' \
	--abbrev-commit --date=relative

	ack = "!git_ack() {\
	git ls-files 2>/dev/null\
	  | ${ACK:-ack} --files-from - \"$@\" 2>/dev/null\
	  || ${ACK:-ack} \"$@\";\
	}; git_ack"

[core]
	editor = vim

[push]
	default = simple

[column]
	status = auto

[color]
	branch = auto
	diff = auto
	status = auto

[color "branch"]
	current = yellow reverse
	local = yellow
	remote = green

[color "diff"]
	meta = black reverse bold
	frag = magenta reverse bold
	func = magenta bold
	old = red bold
	new = green bold

[color "status"]
	added = yellow
	changed = green
	untracked = cyan

[http]
	sslCAInfo = /home/jpokorny/.pki/tls/certs/ca-bundle.crt

# http://lukas.zapletalovi.com/2012/06/three-way-git-merging-and-meld.html
# -> http://lukas.zapletalovi.com/2012/09/three-way-git-merging-with-meld.html
[merge]
	tool = mymeld
	conflictstyle = diff3

[mergetool "mymeld"]
	cmd = meld --diff $BASE $LOCAL --diff $BASE $REMOTE --diff $LOCAL $BASE $REMOTE $MERGED

[sendemail]
	smtpserver = smtp.corp.redhat.com

[include]
	path = ~/.gitconfig-priv