~mrls/dotfiles

69bcf145dcf03cfda52bf0fb76b0f0138b286361 — Mauro Morales 4 years ago
Git configuration
1 files changed, 34 insertions(+), 0 deletions(-)

A .config/git/config
A  => .config/git/config +34 -0
@@ 1,34 @@
[user]
	email = mr@mrls.xyz
	name = Mauro Morales
[core]
	editor = nvim
[branch]
	sort = -committerdate
[merge]
	tool = fugitive
[mergetool "vimdiff"]
  # cmd = nvim -d $LOCAL $BASE $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[mergetool "fugitive"]
  cmd = nvim +Gdiff $MERGED
[diff]
  tool = fugitive
[alias]
	lol = log --graph --decorate --oneline
	lola = log --graph --decorate --oneline --all
	# list files which have changed since REVIEW_BASE
	# (REVIEW_BASE defaults to 'master' in my zshrc)
	files = !git diff --name-only $(git merge-base HEAD $REVIEW_BASE)
	# Same as above, but with a diff stat instead of just names
	# (better for interactive use)
	stat = !git diff --stat $(git merge-base HEAD $REVIEW_BASE)
	hm = !git log --all -M -C --name-only --format='format:' -- $(git files | xargs) | sort | grep -v '^$' | uniq -c | sort -n
	# Open all files changed since REVIEW_BASE in Vim tabs
	# Then, run fugitive's :Gdiff in each tab, and finally
	# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
	review = !nvim -p $(git files) +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
	# Same as the above, except specify names of files as arguments,
	# instead of opening all files:
	# git reviewone foo.js bar.js
	reviewone = !nvim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
	what = !hub-pr-what