]> Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/git-up
bin/git-subup: Force "git checkout master" foreach submodule
[dotfiles.git] / bin / git-up
1 #!/bin/sh
2
3 # Usage: git-up
4 # git-reup
5 #
6 # Like git-pull but show a short and sexy log of changes
7 # immediately after merging (git-up) or rebasing (git-reup).
8 #
9 # Inspired by Kyle Neath's `git up' alias:
10 # http://gist.github.com/249223
11
12 set -e
13
14 PULL_ARGS="$@"
15
16 # when invoked as git-reup, run as `git pull --rebase'
17 test "$(basename $0)" = "git-reup" &&
18 PULL_ARGS="--rebase $PULL_ARGS"
19
20 git pull $PULL_ARGS
21
22 # show diffstat of all changes if we're pulling with --rebase. not
23 # sure why git-pull only does this when merging.
24 test "$(basename $0)" = "git-reup" && {
25 echo "Diff:"
26 git --no-pager diff --color --stat HEAD@{1}.. |
27 sed 's/^/ /'
28 }
29
30 # show an abbreviated commit log of stuff that was just merged.
31 echo "Log:"
32 git log --color --pretty=oneline --abbrev-commit HEAD@{1}.. |
33 sed 's/^/ /'