{"thread":{"id":"26490","subject":"[STGIT] AssertionError on stg rebase","startedAt":"2011-02-13T19:35:34Z","lastAt":"2011-02-14T17:23:15Z","messageCount":2,"participants":["Henrique de Moraes Holschuh","Catalin Marinas"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"161013","messageId":"20110213193534.GA2437@khazad-dum.debian.net","threadId":"26490","inReplyTo":null,"subject":"[STGIT] AssertionError on stg rebase","fromName":"Henrique de Moraes Holschuh","fromEmail":"hmh@hmh.eng.br","sentAt":"2011-02-13T19:35:34Z","receivedAt":"2011-02-13T19:35:34Z","isPatch":false,"sender":{"key":"hmh@hmh.eng.br","avatar":null},"body":"(please keep me CC'd, I am currently not subscribed to the git ML)\n\nIt appears stgit dislikes something on the v2.6.27 longterm tree, or\nsomething else is hosed on my system.  It is causing me a lot of\ntrouble, I now have a few backport branches that are unusable, and that\nI'd like very much to fix...\n\nTested with stgit 0.15, and also stgit \"proposed\" branch.  Debian\nsqueeze, both in ia32 and x86-64.\n\n\nHere is a testcase to reproduce the problem:\n\n$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/longterm/linux-2.6.27.y.git\n$ cd linux-2.6.27.y\n$ git reset --hard v2.6.27.53\n$ stg init\n$ stg new test-patch-1\n$ echo \"something\" > changedfile\n$ git add changedfile\n$ stg refresh\n\n$ stg rebase v2.6.27.58\n\nChecking for changes in the working directory ... done\nPopping all applied patches ... done\nRebasing to \"v2.6.27.58\" ... done\nPushing patch \"test-patch-1\" ... done\nNow at patch \"test-patch-1\"\nTraceback (most recent call last):\n  File \"/usr/bin/stg\", line 44, in <module>\n    main()\n  File \"/usr/lib/pymodules/python2.6/stgit/main.py\", line 175, in main\n    _main()\n  File \"/usr/lib/pymodules/python2.6/stgit/main.py\", line 170, in _main\n    directory.write_log(cmd)\n  File \"/usr/lib/pymodules/python2.6/stgit/commands/common.py\", line 537, in write_log\n    log.compat_log_entry(msg)\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 372, in compat_log_entry\n    log_entry(stack, msg)\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 328, in log_entry\n    new_log.write_commit()\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 283, in write_commit\n    tree = self.__tree(metadata)\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 277, in __tree\n    patches = dict((pn, pf(c)) for pn, c in self.patches.iteritems())\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 277, in <genexpr>\n    patches = dict((pn, pf(c)) for pn, c in self.patches.iteritems())\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 275, in pf\n    r = patch_file(self.__repo, c.data)\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/log.py\", line 116, in patch_file\n    'Bottom: %s' % cd.parent.data.tree.sha1,\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/git.py\", line 426, in data\n    self.__repository.cat_object(self.sha1))\n  File \"/usr/lib/pymodules/python2.6/stgit/lib/git.py\", line 408, in parse\n    assert False\nAssertionError\n\n\nI have other failure modes that also result on assertions, but they all\nlook like the same basic problem, and this one is at least easy to\nreproduce.\n\n-- \n  \"One disk to rule them all, One disk to find them. One disk to bring\n  them all and in the darkness grind them. In the Land of Redmond\n  where the shadows lie.\" -- The Silicon Valley Tarot\n  Henrique Holschuh\n"},{"id":"161074","messageId":"AANLkTim2F1B7=Q5wTfxxWod3yyyiMuGxKnEGNyCVjcuZ@mail.gmail.com","threadId":"26490","inReplyTo":"20110213193534.GA2437@khazad-dum.debian.net","subject":"Re: [STGIT] AssertionError on stg rebase","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2011-02-14T17:23:15Z","receivedAt":"2011-02-14T17:23:15Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"Hi,\n\nOn 13 February 2011 19:35, Henrique de Moraes Holschuh <hmh@hmh.eng.br> wrote:\n> Here is a testcase to reproduce the problem:\n>\n> $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/longterm/linux-2.6.27.y.git\n> $ cd linux-2.6.27.y\n> $ git reset --hard v2.6.27.53\n> $ stg init\n> $ stg new test-patch-1\n> $ echo \"something\" > changedfile\n> $ git add changedfile\n> $ stg refresh\n>\n> $ stg rebase v2.6.27.58\n>\n> Checking for changes in the working directory ... done\n> Popping all applied patches ... done\n> Rebasing to \"v2.6.27.58\" ... done\n> Pushing patch \"test-patch-1\" ... done\n> Now at patch \"test-patch-1\"\n> Traceback (most recent call last):\n[...]\n>  File \"/usr/lib/pymodules/python2.6/stgit/lib/git.py\", line 408, in parse\n>    assert False\n> AssertionError\n\nStGit is parsing the commit information for some key/value pairs. It\nlooks like it found one which it didn't know about - \"encoding:\nlatin1\" and it failed.\n\nFor now it is OK to just remove the assert. The drawback is that if\nyou do some \"stg uncommit\" on some existing commits, it will lose\nadditional information but I don't think it matters to you since you\ncreate your patches with StGit anyway and it doesn't generate such\ninformation. Longer term we may want to preserve other things that may\nappear in the commit data. I'll push this to the StGit repository as\nwell.\n\n\ndiff --git a/stgit/lib/git.py b/stgit/lib/git.py\nindex 3378728..f5ea965 100644\n--- a/stgit/lib/git.py\n+++ b/stgit/lib/git.py\n@@ -404,8 +404,6 @@ class CommitData(Immutable, Repr):\n                 cd = cd.set_author(Person.parse(value))\n             elif key == 'committer':\n                 cd = cd.set_committer(Person.parse(value))\n-            else:\n-                assert False\n         assert False\n\n class Commit(GitObject):\n\n\nThanks.\n\n-- \nCatalin\n"}]}