git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGIT PATCH 1/3] Command to move a patch to the top

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Oct 3, 2006, 21:34 UTC
Message-ID
<20061003213453.26195.54830.stgit@lathund.dewire.com>
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
Next: Robin Rosenberg
Message 1 of 4 in “Command to move a patch to the top”
  1. 1/3 Command to move a patch to the topRobin Rosenberg, Oct 3, 2006
  2. 2/3 Add an optional prefix to the PATCH subject when mailing.Robin Rosenberg, Oct 3, 2006
  3. 3/3 Fix the --cover option.Robin Rosenberg, Oct 3, 2006
  4. (Repost) Command to move a patch to the topRobin Rosenberg, Oct 5, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.