git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [StGIT PATCH 1/3] Command to move a patch to the top
@ 2006-10-03 21:34 Robin Rosenberg
  2006-10-03 21:34 ` [StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing Robin Rosenberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Robin Rosenberg @ 2006-10-03 21:34 UTC (permalink / raw)
  To: git

From: Robin Rosenberg <robin.rosenberg@dewire.com>


---

 stgit/main.py    |    3 +++
 t/t1500-float.sh |   44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/stgit/main.py b/stgit/main.py
index f59bce6..e9cc6cd 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -38,6 +38,7 @@ import stgit.commands.clone
 import stgit.commands.commit
 import stgit.commands.export
 import stgit.commands.files
+import stgit.commands.float
 import stgit.commands.fold
 import stgit.commands.goto
 import stgit.commands.id
@@ -77,6 +78,7 @@ commands = {
     'commit':   stgit.commands.commit,
     'export':   stgit.commands.export,
     'files':    stgit.commands.files,
+    'float':    stgit.commands.float,
     'fold':     stgit.commands.fold,
     'goto':     stgit.commands.goto,
     'id':       stgit.commands.id,
@@ -113,6 +115,7 @@ stackcommands = (
     'applied',
     'clean',
     'commit',
+    'float',
     'goto',
     'init',
     'pop',
diff --git a/t/t1500-float.sh b/t/t1500-float.sh
new file mode 100755
index 0000000..670050f
--- /dev/null
+++ b/t/t1500-float.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Robin Rosenberg
+#
+
+test_description='Test floating a number of patches to the top of the stack
+
+'
+
+. ./test-lib.sh
+
+test_expect_success \
+	'Initialize the StGIT repository' \
+	'stg init &&
+	 stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh &&
+	 stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh &&
+	 stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh &&
+	 stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh &&
+	 stg new E -m "e" && echo E >e.txt && stg add e.txt && stg refresh &&
+	 stg new F -m "f" && echo F >f.txt && stg add f.txt && stg refresh &&
+	 test "`echo \`cat .git/patches/master/applied\``" = "A B C D E F"
+	'
+
+test_expect_success \
+	'Float A to top' \
+	'stg float A &&
+	 test "`echo \`cat .git/patches/master/applied\``" = "B C D E F A"
+	'
+test_expect_success \
+	'Float A to top (noop)' \
+	'stg float A &&
+	 test "`echo \`cat .git/patches/master/applied\``" = "B C D E F A"
+	'
+test_expect_success \
+	'Float B C to top (noop)' \
+	'stg float B C &&
+	 test "`echo \`cat .git/patches/master/applied\``" = "D E F A B C"
+	'
+test_expect_success \
+	'Float E A to top (noop)' \
+	'stg float E A &&
+	 test "`echo \`cat .git/patches/master/applied\``" = "D F B C E A"
+	'
+test_done

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing.
  2006-10-03 21:34 [StGIT PATCH 1/3] Command to move a patch to the top Robin Rosenberg
@ 2006-10-03 21:34 ` Robin Rosenberg
  2006-10-03 21:34 ` [StGIT PATCH 3/3] Fix the --cover option Robin Rosenberg
  2006-10-05 21:09 ` [StGIT PATCH] (Repost) Command to move a patch to the top Robin Rosenberg
  2 siblings, 0 replies; 4+ messages in thread
From: Robin Rosenberg @ 2006-10-03 21:34 UTC (permalink / raw)
  To: git

From: Robin Rosenberg <robin.rosenberg@dewire.com>

This is for submitting patches to mailing lists with multiple
projects.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

 stgit/commands/mail.py   |   15 +++++++++++++++
 templates/covermail.tmpl |    2 +-
 templates/patchmail.tmpl |    2 +-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index bd56f16..8a713a1 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -65,6 +65,7 @@ the following variables:
   %(diffstat)s     - diff statistics
   %(date)s         - current date/time
   %(version)s      - ' version' string passed on the command line (or empty)
+  %(prefix)s       - prefix the subject lines's "PATCH" with this
   %(patchnr)s      - patch number
   %(totalnr)s      - total number of patches to be sent
   %(number)s       - empty if only one patch is sent or ' patchnr/totalnr'
@@ -95,6 +96,8 @@ options = [make_option('-a', '--all',
                        action = 'store_true'),
            make_option('-v', '--version', metavar = 'VERSION',
                        help = 'add VERSION to the [PATCH ...] prefix'),
+           make_option('--prefix', metavar = 'PREFIX',
+                       help = 'add PREFIX to the [...PATCH ...] prefix'),
            make_option('-t', '--template', metavar = 'FILE',
                        help = 'use FILE as the message template'),
            make_option('-c', '--cover', metavar = 'FILE',
@@ -232,6 +235,11 @@ def __build_cover(tmpl, total_nr, msg_id
     else:
         version_str = ''
 
+    if options.prefix:
+        prefix_str = options.prefix + ' '
+    else:
+        prefix_str = ''
+        
     total_nr_str = str(total_nr)
     patch_nr_str = '0'.zfill(len(total_nr_str))
     if total_nr > 1:
@@ -243,6 +251,7 @@ def __build_cover(tmpl, total_nr, msg_id
                  'endofheaders': headers_end,
                  'date':         email.Utils.formatdate(localtime = True),
                  'version':      version_str,
+                 'prefix':	 prefix_str,
                  'patchnr':      patch_nr_str,
                  'totalnr':      total_nr_str,
                  'number':       number_str}
@@ -312,6 +321,11 @@ def __build_message(tmpl, patch, patch_n
     else:
         version_str = ''
 
+    if options.prefix:
+        prefix_str = options.prefix + ' '
+    else:
+        prefix_str = ''
+        
     total_nr_str = str(total_nr)
     patch_nr_str = str(patch_nr).zfill(len(total_nr_str))
     if total_nr > 1:
@@ -330,6 +344,7 @@ def __build_message(tmpl, patch, patch_n
                                               rev2 = git_id('%s//top' % patch)),
                  'date':         email.Utils.formatdate(localtime = True),
                  'version':      version_str,
+                 'prefix':       prefix_str,
                  'patchnr':      patch_nr_str,
                  'totalnr':      total_nr_str,
                  'number':       number_str,
diff --git a/templates/covermail.tmpl b/templates/covermail.tmpl
index 44cd19e..ba1dd9d 100644
--- a/templates/covermail.tmpl
+++ b/templates/covermail.tmpl
@@ -1,5 +1,5 @@
 From: %(maintainer)s
-Subject: [PATCH%(version)s%(number)s] Series short description
+Subject: [%(prefix)sPATCH%(version)s%(number)s] Series short description
 Date: %(date)s
 %(endofheaders)s
 The following series implements...
diff --git a/templates/patchmail.tmpl b/templates/patchmail.tmpl
index 7881993..b0df904 100644
--- a/templates/patchmail.tmpl
+++ b/templates/patchmail.tmpl
@@ -1,5 +1,5 @@
 From: %(maintainer)s
-Subject: [PATCH%(version)s%(number)s] %(shortdescr)s
+Subject: [%(prefix)sPATCH%(version)s%(number)s] %(shortdescr)s
 Date: %(date)s
 %(endofheaders)s
 From: %(authname)s <%(authemail)s>

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [StGIT PATCH 3/3] Fix the --cover option.
  2006-10-03 21:34 [StGIT PATCH 1/3] Command to move a patch to the top Robin Rosenberg
  2006-10-03 21:34 ` [StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing Robin Rosenberg
@ 2006-10-03 21:34 ` Robin Rosenberg
  2006-10-05 21:09 ` [StGIT PATCH] (Repost) Command to move a patch to the top Robin Rosenberg
  2 siblings, 0 replies; 4+ messages in thread
From: Robin Rosenberg @ 2006-10-03 21:34 UTC (permalink / raw)
  To: git

From: Robin Rosenberg <robin.rosenberg@dewire.com>

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

 stgit/commands/mail.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index 8a713a1..c7f0f46 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -419,7 +419,7 @@ def func(parser, options, args):
     if options.cover or options.edit:
         # find the template file
         if options.cover:
-            tmpl = file(options.template).read()
+            tmpl = file(options.cover).read()
         else:
             tmpl = templates.get_template('covermail.tmpl')
             if not tmpl:

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [StGIT PATCH] (Repost) Command to move a patch to the top
  2006-10-03 21:34 [StGIT PATCH 1/3] Command to move a patch to the top Robin Rosenberg
  2006-10-03 21:34 ` [StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing Robin Rosenberg
  2006-10-03 21:34 ` [StGIT PATCH 3/3] Fix the --cover option Robin Rosenberg
@ 2006-10-05 21:09 ` Robin Rosenberg
  2 siblings, 0 replies; 4+ messages in thread
From: Robin Rosenberg @ 2006-10-05 21:09 UTC (permalink / raw)
  To: git

This is a repost of a proposed StGIT command that I find useful. The
previous patch was broken. 

-- robin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-05 21:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-03 21:34 [StGIT PATCH 1/3] Command to move a patch to the top Robin Rosenberg
2006-10-03 21:34 ` [StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing Robin Rosenberg
2006-10-03 21:34 ` [StGIT PATCH 3/3] Fix the --cover option Robin Rosenberg
2006-10-05 21:09 ` [StGIT PATCH] (Repost) Command to move a patch to the top Robin Rosenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).