#!/bin/sh # # Usage: git suck path-to-tree # # Pull all patches relative to 'origin' from the tree specified # and apply them to the current directory tree, keeping all changelog # and authorship information identical. It will update the dates # of the changes of course. (cd $1; git format-patch --suffix=.txt origin) || exit 1 for i in $1/*.txt do sed 's/\[PATCH\] //' <$i >tmp.patch git-applymbox -k tmp.patch || exit 1 done rm -f tmp.patch