3 # Copyright (c) Josef "Jeff" Sipek, 2007
6 source "`dirname $0`/guilt"
8 USAGE
="$USAGE <since>[..[<until>]]"
15 # FIXME, just like guilt-patchbomb, allow hash ranges
18 if [ -z "$rhash" ]; then
20 echo "You must specify a range of commits"
24 # make sure that there are no unapplied changes
25 if ! must_commit_first
; then
26 echo "Uncommited changes detected. Refresh first."
30 echo "About to begin conversion..." >&2
31 echo "Current head: `cat $GIT_DIR/refs/heads/$branch`" >&2
33 for rev in `git-rev-list $rhash`; do
34 if ! head_check
$rev; then
35 echo "aborting..." >&2
39 s
=`git-log --pretty=oneline -1 $rev | cut -c 42-`
41 fname
=`echo $s | sed -e "s/&/and/g" -e "s/[ :]/_/g" -e "s,[/\\],-,g" \
42 -e "s/['\\[{}]//g" -e 's/]//g' | tr A-Z a-z`
44 echo "Converting `echo $rev | cut -c 1-8` as $fname"
46 if [ -f "$GUILT_DIR/$branch/$fname" ]; then
47 echo "Oy, the file "$fname" already exists, what should we do? What should we do?"
56 ) > $GUILT_DIR/$branch/$fname
58 # FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the
59 # timestamp on the patch
61 # insert the patch name into the series file
62 series_insert_patch
$fname
64 # BEWARE: git-reset ahead! Is there a way to verify that we really
65 # created a patch? - We don't want to lose any history.
66 git-reset
--hard $rev^
> /dev
/null
70 echo "Current head: `cat $GIT_DIR/refs/heads/$branch`" >&2