3 # Copyright (c) Josef "Jeff" Sipek, 2006-2010
6 USAGE
="[-eE] [<patchname>]"
14 if [ "$1" = "-e" ]; then
17 elif [ "$1" = "-E" ]; then
26 if [ "$1" = "-e" ]; then
29 elif [ "$1" = "-E" ]; then
39 # are there any patches applied?
40 [ -z "$patch" ] && die
"No patches applied."
42 # check that patch exists in the series
43 ret
=`get_full_series | grep -e "^$patch\$" | wc -l`
44 if [ $ret -eq 0 ]; then
45 die
"Patch $patch is not in the series"
48 # FIXME: warn if we're editing an applied patch
50 TMP_MSG
=`get_tmp_file msg`
51 TMP_DIFF
=`get_tmp_file diff`
53 if [ -z "$edit" ]; then
54 do_get_header
"$GUILT_DIR/$branch/$patch"
56 if [ -n "$full" ]; then
57 git_editor
"$GUILT_DIR/$branch/$patch"
60 do_get_full_header
"$GUILT_DIR/$branch/$patch" > "$TMP_MSG"
61 do_get_patch
"$GUILT_DIR/$branch/$patch" > "$TMP_DIFF"
63 mv "$GUILT_DIR/$branch/$patch" "$GUILT_DIR/$branch/$patch~"
68 ) > "$GUILT_DIR/$branch/$patch"
71 rm -f "$TMP_MSG" "$TMP_DIFF"