-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# vim: syntax=gitconfig | ||
|
||
[user] | ||
name = Stefano Pigozzi | ||
email = [email protected] | ||
[color] | ||
branch = auto | ||
diff = auto | ||
interactive = auto | ||
status = auto | ||
[core] | ||
excludesfile = ~/.gitignore | ||
editor = vim | ||
[merge] | ||
tool = opendiff | ||
[mergetool "mvim"] | ||
cmd=/usr/local/bin/mvim -d -g $LOCAL $MERGED $REMOTE | ||
keepbackup=false | ||
[alias] | ||
st = status | ||
ci = commit | ||
co = checkout | ||
di = diff | ||
dc = diff --cached | ||
amend = commit --amend | ||
aa = add --all | ||
head = !git l -1 | ||
h = !git head | ||
r = !git l -20 | ||
ra = !git r --all | ||
ff = merge --ff-only | ||
pullff = pull --ff-only | ||
noff = merge --no-ff | ||
l = "!source ~/.githelpers && pretty_git_log" | ||
la = !git l --all | ||
div = divergence | ||
gn = goodness | ||
gnc = goodness --cached | ||
fa = fetch --all | ||
pom = push origin master | ||
b = branch | ||
ds = diff --stat=160,120 | ||
dh1 = diff HEAD~1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# vim: syntax=sh | ||
|
||
# Log output: | ||
# | ||
# * 51c333e (12 days) <Gary Bernhardt> add vim-eunuch | ||
# | ||
# The time massaging regexes start with ^[^<]* because that ensures that they | ||
# only operate before the first "<". That "<" will be the beginning of the | ||
# author name, ensuring that we don't destroy anything in the commit message | ||
# that looks like time. | ||
# | ||
# The log format uses } characters between each field, and `column` is later | ||
# used to split on them. A } in the commit subject or any other field will | ||
# break this. | ||
|
||
HASH="%C(yellow)%h%Creset" | ||
RELATIVE_TIME="%Cgreen(%ar)%Creset" | ||
AUTHOR="%C(bold blue)<%an>%Creset" | ||
REFS="%C(red)%d%Creset" | ||
SUBJECT="%s" | ||
|
||
FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT" | ||
|
||
pretty_git_log() { | ||
git log --graph --abbrev-commit --date=relative --pretty="tformat:${FORMAT}" $* | | ||
# Repalce (2 years ago) with (2 years) | ||
sed -Ee 's/(^[^<]*) ago)/\1)/' | | ||
# Replace (2 years, 5 months) with (2 years) | ||
sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?)/\1)/' | | ||
# Line columns up based on } delimiter | ||
column -s '}' -t | | ||
# Page only if we need to | ||
less -FXRS | ||
} |