]>
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 
  11 # Stolen from Ryan Tomayko 
  12 # http://github.com/rtomayko/dotfiles/blob/rtomayko/bin/git-up 
  16 if [ "$(basename $0)" = "git-reup" ]; then 
  17     # when invoked as git-reup, run as `git pull --rebase ...' 
  21     # when invoked as git-up, run as `git pull ...` 
  23     if [ " $@" = " " ]; then 
  24         # when invoked without a repo/head, fetch (and prune) all remotes 
  25         FETCH_ARGS
="--all --prune" 
  29 HEAD_OLD
=$(git rev-parse HEAD) 
  30 git pull 
$PULL_ARGS $FETCH_ARGS $@
 
  31 HEAD_NEW
=$(git rev-parse 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/^/  /'