{"thread":{"id":"5803","subject":"[StGIT PATCH 3/3] Fix the --cover option.","startedAt":"2006-10-03T21:34:53Z","lastAt":"2006-10-05T21:09:45Z","messageCount":4,"participants":["Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"28189","messageId":"20061003213453.26195.54830.stgit@lathund.dewire.com","threadId":"5803","inReplyTo":null,"subject":"[StGIT PATCH 1/3] Command to move a patch to the top","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2006-10-03T21:34:53Z","receivedAt":"2006-10-03T21:34:53Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"From: Robin Rosenberg <robin.rosenberg@dewire.com>\n\n\n---\n\n stgit/main.py    |    3 +++\n t/t1500-float.sh |   44 ++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 47 insertions(+), 0 deletions(-)\n\ndiff --git a/stgit/main.py b/stgit/main.py\nindex f59bce6..e9cc6cd 100644\n--- a/stgit/main.py\n+++ b/stgit/main.py\n@@ -38,6 +38,7 @@ import stgit.commands.clone\n import stgit.commands.commit\n import stgit.commands.export\n import stgit.commands.files\n+import stgit.commands.float\n import stgit.commands.fold\n import stgit.commands.goto\n import stgit.commands.id\n@@ -77,6 +78,7 @@ commands = {\n     'commit':   stgit.commands.commit,\n     'export':   stgit.commands.export,\n     'files':    stgit.commands.files,\n+    'float':    stgit.commands.float,\n     'fold':     stgit.commands.fold,\n     'goto':     stgit.commands.goto,\n     'id':       stgit.commands.id,\n@@ -113,6 +115,7 @@ stackcommands = (\n     'applied',\n     'clean',\n     'commit',\n+    'float',\n     'goto',\n     'init',\n     'pop',\ndiff --git a/t/t1500-float.sh b/t/t1500-float.sh\nnew file mode 100755\nindex 0000000..670050f\n--- /dev/null\n+++ b/t/t1500-float.sh\n@@ -0,0 +1,44 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2006 Robin Rosenberg\n+#\n+\n+test_description='Test floating a number of patches to the top of the stack\n+\n+'\n+\n+. ./test-lib.sh\n+\n+test_expect_success \\\n+\t'Initialize the StGIT repository' \\\n+\t'stg init &&\n+\t stg new A -m \"a\" && echo A >a.txt && stg add a.txt && stg refresh &&\n+\t stg new B -m \"b\" && echo B >b.txt && stg add b.txt && stg refresh &&\n+\t stg new C -m \"c\" && echo C >c.txt && stg add c.txt && stg refresh &&\n+\t stg new D -m \"d\" && echo D >d.txt && stg add d.txt && stg refresh &&\n+\t stg new E -m \"e\" && echo E >e.txt && stg add e.txt && stg refresh &&\n+\t stg new F -m \"f\" && echo F >f.txt && stg add f.txt && stg refresh &&\n+\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"A B C D E F\"\n+\t'\n+\n+test_expect_success \\\n+\t'Float A to top' \\\n+\t'stg float A &&\n+\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"B C D E F A\"\n+\t'\n+test_expect_success \\\n+\t'Float A to top (noop)' \\\n+\t'stg float A &&\n+\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"B C D E F A\"\n+\t'\n+test_expect_success \\\n+\t'Float B C to top (noop)' \\\n+\t'stg float B C &&\n+\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"D E F A B C\"\n+\t'\n+test_expect_success \\\n+\t'Float E A to top (noop)' \\\n+\t'stg float E A &&\n+\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"D F B C E A\"\n+\t'\n+test_done\n"},{"id":"28190","messageId":"20061003213455.26195.63109.stgit@lathund.dewire.com","threadId":"5803","inReplyTo":"20061003213453.26195.54830.stgit@lathund.dewire.com","subject":"[StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2006-10-03T21:34:55Z","receivedAt":"2006-10-03T21:34:55Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"From: Robin Rosenberg <robin.rosenberg@dewire.com>\n\nThis is for submitting patches to mailing lists with multiple\nprojects.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n\n stgit/commands/mail.py   |   15 +++++++++++++++\n templates/covermail.tmpl |    2 +-\n templates/patchmail.tmpl |    2 +-\n 3 files changed, 17 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex bd56f16..8a713a1 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -65,6 +65,7 @@ the following variables:\n   %(diffstat)s     - diff statistics\n   %(date)s         - current date/time\n   %(version)s      - ' version' string passed on the command line (or empty)\n+  %(prefix)s       - prefix the subject lines's \"PATCH\" with this\n   %(patchnr)s      - patch number\n   %(totalnr)s      - total number of patches to be sent\n   %(number)s       - empty if only one patch is sent or ' patchnr/totalnr'\n@@ -95,6 +96,8 @@ options = [make_option('-a', '--all',\n                        action = 'store_true'),\n            make_option('-v', '--version', metavar = 'VERSION',\n                        help = 'add VERSION to the [PATCH ...] prefix'),\n+           make_option('--prefix', metavar = 'PREFIX',\n+                       help = 'add PREFIX to the [...PATCH ...] prefix'),\n            make_option('-t', '--template', metavar = 'FILE',\n                        help = 'use FILE as the message template'),\n            make_option('-c', '--cover', metavar = 'FILE',\n@@ -232,6 +235,11 @@ def __build_cover(tmpl, total_nr, msg_id\n     else:\n         version_str = ''\n \n+    if options.prefix:\n+        prefix_str = options.prefix + ' '\n+    else:\n+        prefix_str = ''\n+        \n     total_nr_str = str(total_nr)\n     patch_nr_str = '0'.zfill(len(total_nr_str))\n     if total_nr > 1:\n@@ -243,6 +251,7 @@ def __build_cover(tmpl, total_nr, msg_id\n                  'endofheaders': headers_end,\n                  'date':         email.Utils.formatdate(localtime = True),\n                  'version':      version_str,\n+                 'prefix':\t prefix_str,\n                  'patchnr':      patch_nr_str,\n                  'totalnr':      total_nr_str,\n                  'number':       number_str}\n@@ -312,6 +321,11 @@ def __build_message(tmpl, patch, patch_n\n     else:\n         version_str = ''\n \n+    if options.prefix:\n+        prefix_str = options.prefix + ' '\n+    else:\n+        prefix_str = ''\n+        \n     total_nr_str = str(total_nr)\n     patch_nr_str = str(patch_nr).zfill(len(total_nr_str))\n     if total_nr > 1:\n@@ -330,6 +344,7 @@ def __build_message(tmpl, patch, patch_n\n                                               rev2 = git_id('%s//top' % patch)),\n                  'date':         email.Utils.formatdate(localtime = True),\n                  'version':      version_str,\n+                 'prefix':       prefix_str,\n                  'patchnr':      patch_nr_str,\n                  'totalnr':      total_nr_str,\n                  'number':       number_str,\ndiff --git a/templates/covermail.tmpl b/templates/covermail.tmpl\nindex 44cd19e..ba1dd9d 100644\n--- a/templates/covermail.tmpl\n+++ b/templates/covermail.tmpl\n@@ -1,5 +1,5 @@\n From: %(maintainer)s\n-Subject: [PATCH%(version)s%(number)s] Series short description\n+Subject: [%(prefix)sPATCH%(version)s%(number)s] Series short description\n Date: %(date)s\n %(endofheaders)s\n The following series implements...\ndiff --git a/templates/patchmail.tmpl b/templates/patchmail.tmpl\nindex 7881993..b0df904 100644\n--- a/templates/patchmail.tmpl\n+++ b/templates/patchmail.tmpl\n@@ -1,5 +1,5 @@\n From: %(maintainer)s\n-Subject: [PATCH%(version)s%(number)s] %(shortdescr)s\n+Subject: [%(prefix)sPATCH%(version)s%(number)s] %(shortdescr)s\n Date: %(date)s\n %(endofheaders)s\n From: %(authname)s <%(authemail)s>\n"},{"id":"28188","messageId":"20061003213457.26195.55955.stgit@lathund.dewire.com","threadId":"5803","inReplyTo":"20061003213453.26195.54830.stgit@lathund.dewire.com","subject":"[StGIT PATCH 3/3] Fix the --cover option.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2006-10-03T21:34:57Z","receivedAt":"2006-10-03T21:34:57Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"From: Robin Rosenberg <robin.rosenberg@dewire.com>\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n\n stgit/commands/mail.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex 8a713a1..c7f0f46 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -419,7 +419,7 @@ def func(parser, options, args):\n     if options.cover or options.edit:\n         # find the template file\n         if options.cover:\n-            tmpl = file(options.template).read()\n+            tmpl = file(options.cover).read()\n         else:\n             tmpl = templates.get_template('covermail.tmpl')\n             if not tmpl:\n"},{"id":"28254","messageId":"20061005210945.16972.397.stgit@lathund.dewire.com","threadId":"5803","inReplyTo":"20061003213453.26195.54830.stgit@lathund.dewire.com","subject":"[StGIT PATCH] (Repost) Command to move a patch to the top","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2006-10-05T21:09:45Z","receivedAt":"2006-10-05T21:09:45Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"This is a repost of a proposed StGIT command that I find useful. The\nprevious patch was broken. \n\n-- robin\n"}]}