{"thread":{"id":"9310","subject":"[GUILT PATCH] guilt-header: Add -e option for editing","startedAt":"2007-07-30T14:34:28Z","lastAt":"2007-07-30T19:09:54Z","messageCount":2,"participants":["Eric Lesh","Josef Sipek"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49105","messageId":"87r6mqarkb.fsf@hubert.paunchy.net","threadId":"9310","inReplyTo":null,"subject":"[GUILT PATCH] guilt-header: Add -e option for editing","fromName":"Eric Lesh","fromEmail":"eclesh@ucla.edu","sentAt":"2007-07-30T14:34:28Z","receivedAt":"2007-07-30T14:34:28Z","isPatch":true,"sender":{"key":"eclesh@ucla.edu","avatar":null},"body":"Signed-off-by: Eric Lesh <eclesh@ucla.edu>\n---\n Documentation/guilt-header.txt |    6 ++++--\n guilt                          |    9 +++++++++\n guilt-header                   |   20 +++++++++++++++++---\n 3 files changed, 30 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/guilt-header.txt b/Documentation/guilt-header.txt\nindex ed9ab34..d432959 100644\n--- a/Documentation/guilt-header.txt\n+++ b/Documentation/guilt-header.txt\n@@ -11,10 +11,12 @@ include::usage-guilt-header.txt[]\n \n DESCRIPTION\n -----------\n-Prints either the topmost patches' header or the header of a specified patch.\n+Prints either the topmost patch's header or the header of a specified patch.\n \n+-e::\n+        Open the header in an editor, instead of printing it.\n <patchname>::\n-\tName of the patch. \n+\tName of the patch.\n \n Author\n ------\ndiff --git a/guilt b/guilt\nindex f67bfb5..7f2b93c 100755\n--- a/guilt\n+++ b/guilt\n@@ -209,6 +209,15 @@ do_make_header()\n \t'\n }\n \n+# usage: do_get_patch patchfile\n+do_get_patch()\n+{\n+\tcat \"$1\" | awk '\n+BEGIN{}\n+/^(diff|---)/,/END{}/\n+'\n+}\n+\n # usage: do_get_header patchfile\n do_get_header()\n {\ndiff --git a/guilt-header b/guilt-header\nindex d07e2be..496cb5b 100755\n--- a/guilt-header\n+++ b/guilt-header\n@@ -3,13 +3,18 @@\n # Copyright (c) Josef \"Jeff\" Sipek, 2006, 2007\n #\n \n-USAGE=\"[<patchname>]\"\n+USAGE=\"[-e] [<patchname>]\"\n . `dirname $0`/guilt\n \n-if [ $# -gt 1 ]; then\n+if [ $# -gt 2 ]; then\n \tusage\n fi\n \n+if [ \"$1\" = \"-e\" ]; then\n+\tedit=t\n+\tshift\n+fi\n+\n patch=\"$1\"\n \n if [ -z \"$patch\" ]; then\n@@ -34,6 +39,15 @@ for p in `get_series`; do\n \t[ $idx -lt $eidx ] && continue\n \t[ $idx -gt $eidx ] && break\n \n-\tdo_get_header $GUILT_DIR/$branch/$p\n+\tif [ -z \"$edit\" ]; then\n+\t\tdo_get_header $GUILT_DIR/$branch/$p\n+\telse\n+\t\tdo_get_full_header $GUILT_DIR/$branch/$p > /tmp/guilt.msg.$$\n+\t\tdo_get_patch  $GUILT_DIR/$branch/$p > /tmp/guilt.diff.$$\n+\t\t$editor \"/tmp/guilt.msg.$$\"\n+\t\tmv $GUILT_DIR/$branch/$p $GUILT_DIR/$branch/$p~\n+\t\tcat /tmp/guilt.msg.$$ > $GUILT_DIR/$branch/$p\n+\t\tcat /tmp/guilt.diff.$$ >> $GUILT_DIR/$branch/$p\n+\tfi\n done\n \n-- \n1.5.2\n"},{"id":"49122","messageId":"20070730190954.GA17253@filer.fsl.cs.sunysb.edu","threadId":"9310","inReplyTo":"87r6mqarkb.fsf@hubert.paunchy.net","subject":"Re: [GUILT PATCH] guilt-header: Add -e option for editing","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-07-30T19:09:54Z","receivedAt":"2007-07-30T19:09:54Z","isPatch":true,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Mon, Jul 30, 2007 at 07:34:28AM -0700, Eric Lesh wrote:\n> Signed-off-by: Eric Lesh <eclesh@ucla.edu>\n> ---\n>  Documentation/guilt-header.txt |    6 ++++--\n>  guilt                          |    9 +++++++++\n>  guilt-header                   |   20 +++++++++++++++++---\n>  3 files changed, 30 insertions(+), 5 deletions(-)\n\nApplied. Right after applying your patch, I decided to clean things up a\nbit. This includes removal of the scan of the series => not needed as we\nalready know the patch name anyway.\n\nThanks,\n\nJosef 'Jeff' Sipek.\n\n-- \nI already backed up the [server] once, I can do it again.\n"}]}