Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge diverging branch

  • Loading branch information...
commit a530d0d1dd3072a6d98392c83696e49b47d23f6a 2 parents cae2761 + 245b2c6
@VanTanev authored
Showing with 56 additions and 9 deletions.
  1. +20 −9 .gitconfig
  2. +35 −0 .githelpers
  3. +1 −0  .gitignore
View
29 .gitconfig
@@ -26,14 +26,25 @@
whitespace=fix;-ident-with-non-tab,trailing-space,cr-at-eol
[alias]
- st = status
- ci = commit
- br = branch
- co = checkout
- df = diff
- lg = log -p
- datetag = !git tag `date "+%Y%m%d%H%M"`
-
+ st = status
+ aa = add --all
+ ci = commit
+ co = checkout
+ di = diff
+ dc = diff --cached
+ amend = commit --amend
+ h = !git head
+ l = "!source ~/.githelpers && pretty_git_log"
+ la = !git l --all
+ r = !git l -20
+ ra = !git r --all
+ ff = merge --ff-only
+ pullff = pull --ff-only
+ noff = merge --no-ff
+ pom = push origin master
+ br = branch
+ df = diff
+ tagdate = !git tag `date "+%Y%m%d%H%M"`
# Show status and diff of dirty submodules
subdiff = !"git submodule foreach --recursive --quiet '[ \"$(git status -s)\" ] && echo \"--- $name ---\" && git status -s && git diff --unified=1 || :'"
@@ -64,4 +75,4 @@
# example: search commits for "foobar", print full diff of commit with 1 line context
# git searchcommits foobar --pickaxe-all -U1 src/lib
searchcommits = "!f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\""
-
+
View
35 .githelpers
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# 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 -FXRSE
+}
+
View
1  .gitignore
@@ -4,6 +4,7 @@
!.bashrc
!.gitconfig
!.gitignore
+!.githelpers
!.git-flow-completion.sh
!.symfony-completion.sh
!.bash-ssh-agent.sh
Please sign in to comment.
Something went wrong with that request. Please try again.