]>
Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/git-up
6 # Like git-pull but show a short and sexy log of changes
7 # immediately after merging (git-up) or rebasing (git-reup).
9 # Inspired by Kyle Neath's `git up' alias:
10 # http://gist.github.com/249223
16 if [ "$(basename $0)" = "git-reup" ]; then
17 # when invoked as git-reup, run as `git pull --rebase ...'
18 PULL_ARGS
="--rebase $PULL_ARGS"
21 # when invoked as git-up, run as `git pull ...`
22 PULL_ARGS
="--ff-only $PULL_ARGS"
23 if [ " $@" = " " ]; then
24 # when invoked without a repo/head, fetch (and prune) all remotes
25 FETCH_ARGS
="--all --prune"
29 HEAD_OLD
=$(git log -1 --pretty='format:%H' HEAD)
30 git pull
$PULL_ARGS $FETCH_ARGS $@
31 HEAD_NEW
=$(git log -1 --pretty='format:%H' HEAD)
33 if [ "$HEAD_OLD" != "$HEAD_NEW" ]; then
34 # if HEAD was actually updated...
35 if [ "$(basename $0)" = "git-reup" ]; then
36 # if we're pulling with --rebase, show diffstat of all changes.
37 # not sure why git-pull only does this when merging.
39 git
--no-pager diff --color --stat ${HEAD_OLD}..
| sed 's/^/ /'
42 # show an abbreviated commit log of stuff that was just merged.
44 git log
--color --pretty=oneline
--abbrev-commit ${HEAD_OLD}..
| sed 's/^/ /'