{"thread":{"id":"10813","subject":"[StGit PATCH 0/5] A few small fixes","startedAt":"2007-11-11T19:43:24Z","lastAt":"2007-11-12T13:01:21Z","messageCount":8,"participants":["Karl Hasselström","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"59364","messageId":"20071111193545.18868.62490.stgit@yoghurt","threadId":"10813","inReplyTo":null,"subject":"[StGit PATCH 0/5] A few small fixes","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-11T19:43:24Z","receivedAt":"2007-11-11T19:43:24Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"These are available from\n\n  git://repo.or.cz/stgit/kha.git safe\n\nThe clean test and the assimilare/repair stuff are new, the rest have\nbeen sitting in kha/safe for a while now.\n\nDavid: I believe the repair patch should fix the situation you\nencountered.\n\n---\n\nNote how the actual patch that renames assimilate to repair looks fine\n-- I gave stg mail --diff-opts='-M -C -C'. But the diffstats\napparently don't get those flags, neither the aggregate one below nor\nthe one just for that patch. We ought to fix that ...\n\nKarl Hasselström (5):\n      stg repair: Patchify non-patch commits between patches\n      Rename \"stg assimilate\" to \"stg repair\"\n      Let some commands work with detached HEAD\n      Cogito is deprecated, so don't point to it\n      Simple test for \"stg clean\"\n\n\n Documentation/stg.txt         |    4 -\n README                        |    4 -\n contrib/stgit-completion.bash |    2 \n stgit/commands/add.py         |    2 \n stgit/commands/assimilate.py  |  198 -----------------------------------------\n stgit/commands/common.py      |    2 \n stgit/commands/repair.py      |  192 ++++++++++++++++++++++++++++++++++++++++\n stgit/commands/resolved.py    |    2 \n stgit/commands/status.py      |    2 \n stgit/main.py                 |    4 -\n t/t1301-assimilate.sh         |   84 -----------------\n t/t1301-repair.sh             |   80 +++++++++++++++++\n t/t1302-assimilate-interop.sh |   59 ------------\n t/t1302-repair-interop.sh     |   59 ++++++++++++\n t/t2500-clean.sh              |   27 ++++++\n 15 files changed, 368 insertions(+), 353 deletions(-)\n delete mode 100644 stgit/commands/assimilate.py\n create mode 100644 stgit/commands/repair.py\n delete mode 100755 t/t1301-assimilate.sh\n create mode 100755 t/t1301-repair.sh\n delete mode 100755 t/t1302-assimilate-interop.sh\n create mode 100755 t/t1302-repair-interop.sh\n create mode 100755 t/t2500-clean.sh\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"59365","messageId":"20071111194334.18868.87832.stgit@yoghurt","threadId":"10813","inReplyTo":"20071111193545.18868.62490.stgit@yoghurt","subject":"[StGit PATCH 1/5] Simple test for \"stg clean\"","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-11T19:43:37Z","receivedAt":"2007-11-11T19:43:37Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Signed-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n t/t2500-clean.sh |   27 +++++++++++++++++++++++++++\n 1 files changed, 27 insertions(+), 0 deletions(-)\n create mode 100755 t/t2500-clean.sh\n\n\ndiff --git a/t/t2500-clean.sh b/t/t2500-clean.sh\nnew file mode 100755\nindex 0000000..3364c18\n--- /dev/null\n+++ b/t/t2500-clean.sh\n@@ -0,0 +1,27 @@\n+#!/bin/sh\n+\n+test_description='Run \"stg clean\"'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'Initialize StGit stack' '\n+    stg init &&\n+    stg new e0 -m e0 &&\n+    stg new p0 -m p0 &&\n+    echo foo > foo.txt &&\n+    git add foo.txt &&\n+    stg refresh &&\n+    stg new e1 -m e1 &&\n+    stg new e2 -m e2 &&\n+    stg pop\n+'\n+\n+test_expect_success 'Clean empty patches' '\n+    [ \"$(echo $(stg applied))\" = \"e0 p0 e1\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"e2\" ] &&\n+    stg clean &&\n+    [ \"$(echo $(stg applied))\" = \"p0\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ]\n+'\n+\n+test_done\n"},{"id":"59366","messageId":"20071111194343.18868.98023.stgit@yoghurt","threadId":"10813","inReplyTo":"20071111193545.18868.62490.stgit@yoghurt","subject":"[StGit PATCH 2/5] Cogito is deprecated, so don't point to it","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-11T19:43:43Z","receivedAt":"2007-11-11T19:43:43Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Signed-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n README |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\n\ndiff --git a/README b/README\nindex 0e648f5..4f20154 100644\n--- a/README\n+++ b/README\n@@ -6,9 +6,7 @@ other repositories using standard GIT functionality.\n \n Note that StGIT is not an SCM interface on top of GIT and it expects a\n previously initialised GIT repository (unless it is cloned using StGIT\n-directly). For standard SCM operations, either use plain GIT commands\n-or the Cogito tool but it is not recommended to mix them with the\n-StGIT commands.\n+directly). For standard SCM operations, use plain GIT commands.\n \n For the latest version see http://www.procode.org/stgit/\n For a tutorial see http://wiki.procode.org/cgi-bin/wiki.cgi/StGIT_Tutorial\n"},{"id":"59369","messageId":"20071111194349.18868.77565.stgit@yoghurt","threadId":"10813","inReplyTo":"20071111193545.18868.62490.stgit@yoghurt","subject":"[StGit PATCH 3/5] Let some commands work with detached HEAD","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-11T19:43:49Z","receivedAt":"2007-11-11T19:43:49Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"add, resolved, and status didn't use the crt_series that was\ninitialized for them. So don't initialize it, since that means (1)\nless work and (2) they won't fail when HEAD is detached.\n\nNote that this doesn't completely fix the problem with detached HEAD:\na number of other commands (e.g. branch) don't always need to refer to\na current series, but currently fails on a detached HEAD even in those\nsituations.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/add.py      |    2 +-\n stgit/commands/resolved.py |    2 +-\n stgit/commands/status.py   |    2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\n\ndiff --git a/stgit/commands/add.py b/stgit/commands/add.py\nindex 264ab9f..ceea188 100644\n--- a/stgit/commands/add.py\n+++ b/stgit/commands/add.py\n@@ -31,7 +31,7 @@ Add the files or directories passed as arguments to the\n repository. When a directory name is given, all the files and\n subdirectories are recursively added.\"\"\"\n \n-directory = DirectoryHasRepository()\n+directory = DirectoryHasRepository(needs_current_series = False)\n options = []\n \n \ndiff --git a/stgit/commands/resolved.py b/stgit/commands/resolved.py\nindex 236ffd7..011db91 100644\n--- a/stgit/commands/resolved.py\n+++ b/stgit/commands/resolved.py\n@@ -34,7 +34,7 @@ Mark a merge conflict as resolved. The conflicts can be seen with the\n 'C'. This command also removes any <file>.{ancestor,current,patched}\n files.\"\"\"\n \n-directory = DirectoryHasRepository()\n+directory = DirectoryHasRepository(needs_current_series = False)\n options = [make_option('-a', '--all',\n                        help = 'mark all conflicts as solved',\n                        action = 'store_true'),\ndiff --git a/stgit/commands/status.py b/stgit/commands/status.py\nindex 5763d09..20614b0 100644\n--- a/stgit/commands/status.py\n+++ b/stgit/commands/status.py\n@@ -40,7 +40,7 @@ under revision control. The files are prefixed as follows:\n A 'refresh' command clears the status of the modified, new and deleted\n files.\"\"\"\n \n-directory = DirectoryHasRepository()\n+directory = DirectoryHasRepository(needs_current_series = False)\n options = [make_option('-m', '--modified',\n                        help = 'show modified files only',\n                        action = 'store_true'),\n"},{"id":"59367","messageId":"20071111194356.18868.75466.stgit@yoghurt","threadId":"10813","inReplyTo":"20071111193545.18868.62490.stgit@yoghurt","subject":"[StGit PATCH 4/5] Rename \"stg assimilate\" to \"stg repair\"","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-11T19:43:57Z","receivedAt":"2007-11-11T19:43:57Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"With the capabilities it's gained lately, this is a better name.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Documentation/stg.txt         |    4 -\n contrib/stgit-completion.bash |    2 \n stgit/commands/assimilate.py  |  198 -----------------------------------------\n stgit/commands/common.py      |    2 \n stgit/commands/repair.py      |  197 +++++++++++++++++++++++++++++++++++++++++\n stgit/main.py                 |    4 -\n t/t1301-assimilate.sh         |   84 -----------------\n t/t1301-repair.sh             |   80 +++++++++++++++++\n t/t1302-assimilate-interop.sh |   59 ------------\n t/t1302-repair-interop.sh     |   59 ++++++++++++\n 10 files changed, 342 insertions(+), 347 deletions(-)\n delete mode 100644 stgit/commands/assimilate.py\n create mode 100644 stgit/commands/repair.py\n delete mode 100755 t/t1301-assimilate.sh\n create mode 100755 t/t1301-repair.sh\n delete mode 100755 t/t1302-assimilate-interop.sh\n create mode 100755 t/t1302-repair-interop.sh\n\n\ndiff --git a/Documentation/stg.txt b/Documentation/stg.txt\nindex 4f9d18e..f6cd815 100644\n--- a/Documentation/stg.txt\n+++ b/Documentation/stg.txt\n@@ -146,8 +146,8 @@ stglink:commit[]::\n \tstgdesc:commit[]\n stglink:uncommit[]::\n \tstgdesc:uncommit[]\n-stglink:assimilate[]::\n-\tstgdesc:assimilate[]\n+stglink:repair[]::\n+\tstgdesc:repair[]\n \n Controlling what patches are applied\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\ndiff --git a/contrib/stgit-completion.bash b/contrib/stgit-completion.bash\nindex b1d2730..b3b23d4 100644\n--- a/contrib/stgit-completion.bash\n+++ b/contrib/stgit-completion.bash\n@@ -13,7 +13,6 @@\n _stg_commands=\"\n     add\n     applied\n-    assimilate\n     branch\n     delete\n     diff\n@@ -42,6 +41,7 @@ _stg_commands=\"\n     rebase\n     refresh\n     rename\n+    repair\n     resolved\n     rm\n     series\ndiff --git a/stgit/commands/common.py b/stgit/commands/common.py\nindex 2a80e8c..2672dcf 100644\n--- a/stgit/commands/common.py\n+++ b/stgit/commands/common.py\n@@ -114,7 +114,7 @@ def check_head_top_equal(crt_series):\n     if not crt_series.head_top_equal():\n         raise CmdException(\n \"\"\"HEAD and top are not the same. This can happen if you\n-   modify a branch with git. The \"assimilate\" command can\n+   modify a branch with git. The \"repair\" command can\n    fix this situation.\"\"\")\n \n def check_conflicts():\ndiff --git a/stgit/commands/assimilate.py b/stgit/commands/repair.py\nsimilarity index 90%\nrename from stgit/commands/assimilate.py\nrename to stgit/commands/repair.py\nindex be992aa..f8fe624 100644\n--- a/stgit/commands/assimilate.py\n+++ b/stgit/commands/repair.py\n@@ -29,28 +29,28 @@ from stgit import stack, git\n help = 'StGit-ify any git commits made on top of your StGit stack'\n usage = \"\"\"%prog [options]\n \n-\"assimilate\" will repair three kinds of inconsistencies in your StGit\n+\"repair\" will repair three kinds of inconsistencies in your StGit\n stack, all of them caused by using plain git commands on the branch:\n \n   1. If you have made regular git commits on top of your stack of\n-     StGit patches, \"assimilate\" converts them to StGit patches,\n+     StGit patches, \"repair\" converts them to StGit patches,\n      preserving their contents.\n \n   2. Merge commits cannot become patches; if you have committed a\n-     merge on top of your stack, \"assimilate\" will simply mark all\n+     merge on top of your stack, \"repair\" will simply mark all\n      patches below the merge unapplied, since they are no longer\n      reachable. If this is not what you want, use \"git reset\" to get\n-     rid of the merge and run \"assimilate\" again.\n+     rid of the merge and run \"repair\" again.\n \n   3. The applied patches are supposed to be precisely those that are\n      reachable from the branch head. If you have used e.g. \"git reset\"\n      to move the head, some applied patches may no longer be\n      reachable, and some unapplied patches may have become reachable.\n-     \"assimilate\" will correct the appliedness of such patches.\n+     \"repair\" will correct the appliedness of such patches.\n \n Note that these are \"inconsistencies\", not \"errors\"; furthermore,\n-\"assimilate\" will repair them reliably. As long as you are satisfied\n-with the way \"assimilate\" handles them, you have no reason to avoid\n+\"repair\" will repair them reliably. As long as you are satisfied\n+with the way \"repair\" handles them, you have no reason to avoid\n causing them in the first place if that is convenient for you.\"\"\"\n \n directory = DirectoryGotoToplevel()\n@@ -99,11 +99,10 @@ def read_commit_dag(branch):\n     return commits, patches\n \n def func(parser, options, args):\n-    \"\"\"Assimilate a number of patches.\n-    \"\"\"\n+    \"\"\"Repair inconsistencies in StGit metadata.\"\"\"\n \n     def nothing_to_do():\n-        out.info('No commits to assimilate')\n+        out.info('Nothing to repair')\n \n     orig_applied = crt_series.get_applied()\n     orig_unapplied = crt_series.get_unapplied()\n@@ -118,7 +117,7 @@ def func(parser, options, args):\n         raise CmdException(\n             'This branch is protected. Modification is not permitted.')\n \n-    # Find commits to assimilate, and applied patches.\n+    # Find commits that aren't patches, and applied patches.\n     commits, patches = read_commit_dag(crt_series.get_name())\n     c = commits[head]\n     patchify = []\n@@ -149,7 +148,7 @@ def func(parser, options, args):\n                   % (len(hidden), ['es', ''][len(hidden) == 1])),\n                  '%s,' % merge.id, 'and will be considered unapplied.')\n \n-    # Assimilate any linear sequence of commits on top of a patch.\n+    # Make patches of any linear sequence of commits on top of a patch.\n     names = set(p.patch for p in patches)\n     def name_taken(name):\n         return name in names\ndiff --git a/stgit/main.py b/stgit/main.py\nindex e8242c2..a03447f 100644\n--- a/stgit/main.py\n+++ b/stgit/main.py\n@@ -60,7 +60,6 @@ class Commands(dict):\n commands = Commands({\n     'add':              'add',\n     'applied':          'applied',\n-    'assimilate':       'assimilate',\n     'branch':           'branch',\n     'delete':           'delete',\n     'diff':             'diff',\n@@ -89,6 +88,7 @@ commands = Commands({\n     'rebase':           'rebase',\n     'refresh':          'refresh',\n     'rename':           'rename',\n+    'repair':           'repair',\n     'resolved':         'resolved',\n     'rm':               'rm',\n     'series':           'series',\n@@ -109,7 +109,6 @@ repocommands = (\n     )\n stackcommands = (\n     'applied',\n-    'assimilate',\n     'branch',\n     'clean',\n     'commit',\n@@ -122,6 +121,7 @@ stackcommands = (\n     'pull',\n     'push',\n     'rebase',\n+    'repair',\n     'series',\n     'sink',\n     'top',\ndiff --git a/t/t1301-assimilate.sh b/t/t1301-repair.sh\nsimilarity index 70%\nrename from t/t1301-assimilate.sh\nrename to t/t1301-repair.sh\nindex 7f47c31..5d9bdbd 100755\n--- a/t/t1301-assimilate.sh\n+++ b/t/t1301-repair.sh\n@@ -1,19 +1,19 @@\n #!/bin/sh\n # Copyright (c) 2006 Karl Hasselström\n-test_description='Test the assimilate command.'\n+test_description='Test the repair command.'\n . ./test-lib.sh\n \n test_expect_success \\\n-    'Assimilate in a non-initialized repository' \\\n-    '! stg assimilate'\n+    'Repair in a non-initialized repository' \\\n+    '! stg repair'\n \n test_expect_success \\\n     'Initialize the StGIT repository' \\\n     'stg init'\n \n test_expect_success \\\n-    'Assimilate in a repository without patches' \\\n-    'stg assimilate'\n+    'Repair in a repository without patches' \\\n+    'stg repair'\n \n test_expect_success \\\n     'Create a patch' \\\n@@ -25,8 +25,8 @@ test_expect_success \\\n     '\n \n test_expect_success \\\n-    'Assimilate when there is nothing to do' \\\n-    'stg assimilate'\n+    'Repair when there is nothing to do' \\\n+    'stg repair'\n \n test_expect_success \\\n     'Create a GIT commit' \\\n@@ -36,11 +36,9 @@ test_expect_success \\\n     git commit -a -m bar\n     '\n \n-test_expect_success \\\n-    'Assimilate one GIT commit' \\\n-    '\n+test_expect_success 'Turn one GIT commit into a patch' '\n     [ $(stg applied | wc -l) -eq 1 ] &&\n-    stg assimilate &&\n+    stg repair &&\n     [ $(stg applied | wc -l) -eq 2 ]\n     '\n \n@@ -56,11 +54,9 @@ test_expect_success \\\n     git commit -a -m three\n     '\n \n-test_expect_success \\\n-    'Assimilate three GIT commits' \\\n-    '\n+test_expect_success 'Turn three GIT commits into patches' '\n     [ $(stg applied | wc -l) -eq 2 ] &&\n-    stg assimilate &&\n+    stg repair &&\n     [ $(stg applied | wc -l) -eq 5 ]\n     '\n \n@@ -75,9 +71,9 @@ test_expect_success \\\n     git pull . br\n     '\n \n-test_expect_success 'Assimilate in the presence of a merge commit' '\n+test_expect_success 'Repair in the presence of a merge commit' '\n     [ $(stg applied | wc -l) -eq 5 ] &&\n-    stg assimilate &&\n+    stg repair &&\n     [ $(stg applied | wc -l) -eq 0 ]\n '\n \ndiff --git a/t/t1302-assimilate-interop.sh b/t/t1302-repair-interop.sh\nsimilarity index 91%\nrename from t/t1302-assimilate-interop.sh\nrename to t/t1302-repair-interop.sh\nindex 31f8b78..82c5ed2 100755\n--- a/t/t1302-assimilate-interop.sh\n+++ b/t/t1302-repair-interop.sh\n@@ -1,5 +1,5 @@\n #!/bin/sh\n-test_description='Test git/StGit interoperability with \"stg assimilate\"'\n+test_description='Test git/StGit interoperability with \"stg repair\"'\n . ./test-lib.sh\n \n test_expect_success 'Create some git-only history' '\n@@ -28,7 +28,7 @@ test_expect_success 'Create five patches' '\n test_expect_success 'Pop two patches with git-reset' '\n     git reset --hard HEAD~2 &&\n     ! stg refresh &&\n-    stg assimilate &&\n+    stg repair &&\n     stg refresh &&\n     [ \"$(echo $(stg applied))\" = \"p0 p1 p2\" ] &&\n     [ \"$(echo $(stg unapplied))\" = \"p3 p4\" ]\n@@ -43,7 +43,7 @@ test_expect_success 'Create a new patch' '\n test_expect_success 'Go to an unapplied patch with with git-reset' '\n     git reset --hard $(stg id p3) &&\n     ! stg refresh &&\n-    stg assimilate &&\n+    stg repair &&\n     stg refresh &&\n     [ \"$(echo $(stg applied))\" = \"p0 p1 p2 p3\" ] &&\n     [ \"$(echo $(stg unapplied))\" = \"q0 p4\" ]\n@@ -51,7 +51,7 @@ test_expect_success 'Go to an unapplied patch with with git-reset' '\n \n test_expect_success 'Go back to below the stack base with git-reset' '\n     git reset --hard foo-tag &&\n-    stg assimilate &&\n+    stg repair &&\n     [ \"$(echo $(stg applied))\" = \"\" ] &&\n     [ \"$(echo $(stg unapplied))\" = \"p0 p1 p2 p3 q0 p4\" ]\n '\n"},{"id":"59368","messageId":"20071111194404.18868.44443.stgit@yoghurt","threadId":"10813","inReplyTo":"20071111193545.18868.62490.stgit@yoghurt","subject":"[StGit PATCH 5/5] stg repair: Patchify non-patch commits between patches","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-11T19:44:04Z","receivedAt":"2007-11-11T19:44:04Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This teaches \"stg repair\" to find non-patch commits that sit between\npatches, and turn them into patches. This situation can happen e.g.\nlike this:\n\n  stg new -m A && stg new -m B && stg new -m C\n  stg pop A B C\n  stg push B\n  echo foo > foo && git add foo && stg refresh\n  git reset --hard $(stg id C)\n\nThe old \"stg repair\" would at this point simply conclude that A and C\nare applied, and B unapplied. However, B's old commit is still between\nthem even though it's not a patch, which will cause problems later --\nStGit generally assumes that the applied patches are a consecutive\nstring of commits. The new \"stg repair\", on the other hand, will find\nB's old commit, and create a new patch for it.\n\nOne downside of this change is that we can no longer conclude that all\nis well just because head == top, so no-op runs of \"stg repair\" just\ngot more expensive.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/repair.py |   19 +++++++------------\n 1 files changed, 7 insertions(+), 12 deletions(-)\n\n\ndiff --git a/stgit/commands/repair.py b/stgit/commands/repair.py\nindex f8fe624..4787f72 100644\n--- a/stgit/commands/repair.py\n+++ b/stgit/commands/repair.py\n@@ -101,33 +101,28 @@ def read_commit_dag(branch):\n def func(parser, options, args):\n     \"\"\"Repair inconsistencies in StGit metadata.\"\"\"\n \n-    def nothing_to_do():\n-        out.info('Nothing to repair')\n-\n     orig_applied = crt_series.get_applied()\n     orig_unapplied = crt_series.get_unapplied()\n \n-    # If head == top, we're done.\n-    head = git.get_commit(git.get_head()).get_id_hash()\n-    top = crt_series.get_current_patch()\n-    if top and head == top.get_top():\n-        return nothing_to_do()\n-\n     if crt_series.get_protected():\n         raise CmdException(\n             'This branch is protected. Modification is not permitted.')\n \n     # Find commits that aren't patches, and applied patches.\n+    head = git.get_commit(git.get_head()).get_id_hash()\n     commits, patches = read_commit_dag(crt_series.get_name())\n     c = commits[head]\n-    patchify = []\n+    patchify = []       # commits to definitely patchify\n+    maybe_patchify = [] # commits to patchify if we find a patch below them\n     applied = []\n     while len(c.parents) == 1:\n         parent, = c.parents\n         if c.patch:\n             applied.append(c)\n-        elif not applied:\n-            patchify.append(c)\n+            patchify.extend(maybe_patchify)\n+            maybe_patchify = []\n+        else:\n+            maybe_patchify.append(c)\n         c = parent\n     applied.reverse()\n     patchify.reverse()\n"},{"id":"59463","messageId":"b0943d9e0711120302y385676a9o2d5ad50ee3ae2333@mail.gmail.com","threadId":"10813","inReplyTo":"20071111193545.18868.62490.stgit@yoghurt","subject":"Re: [StGit PATCH 0/5] A few small fixes","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-11-12T11:02:54Z","receivedAt":"2007-11-12T11:02:54Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 11/11/2007, Karl Hasselström <kha@treskal.com> wrote:\n> These are available from\n>\n>   git://repo.or.cz/stgit/kha.git safe\n\nThanks. Merged.\n\n>       Let some commands work with detached HEAD\n[...]\n>  stgit/commands/add.py         |    2\n\nMy plan after 0.14 is to remove the implementation of add/rm etc.\ncommands. I'd like to keep them as just synonyms to the equivalent git\ncommands which stgit would invoke (this is mainly for convenience as I\nusually type \"stg\" rather than \"git\").\n\nBTW, I'll review this week the bugs already logged and clean as many\nas possible (help appreciated :-)) and try to release 0.14 in 1-2\nweeks.\n\n-- \nCatalin\n"},{"id":"59479","messageId":"20071112130121.GA30459@diana.vm.bytemark.co.uk","threadId":"10813","inReplyTo":"b0943d9e0711120302y385676a9o2d5ad50ee3ae2333@mail.gmail.com","subject":"Re: [StGit PATCH 0/5] A few small fixes","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-11-12T13:01:21Z","receivedAt":"2007-11-12T13:01:21Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-11-12 11:02:54 +0000, Catalin Marinas wrote:\n\n> My plan after 0.14 is to remove the implementation of add/rm etc.\n> commands.\n\nThere are patches for this in kha/experimental. :-) They are on top of\nDavid's conflict representation series, and I think there might be a\nreason for that. But it was quite a while ago ...\n\nOn top of David's series, \"stg resolved\" should also be superfluous --\nI just haven't gotten around to removing it yet.\n\n> I'd like to keep them as just synonyms to the equivalent git\n> commands which stgit would invoke (this is mainly for convenience as\n> I usually type \"stg\" rather than \"git\").\n\nOK, I can live with that. But I'd like them to be well hidden, so the\napparent command set doesn't become too large.\n\n> BTW, I'll review this week the bugs already logged and clean as many\n> as possible (help appreciated :-))\n\nI think there might be a fair number of bugs that are still open in\nthe bug tracker even though they are fixed.\n\n> and try to release 0.14 in 1-2 weeks.\n\nAll right!\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}