Re: [STGIT] AssertionError on stg rebase
- From
- Catalin Marinas <catalin.marinas@gmail.com>
- Date
- Feb 14, 2011, 17:23 UTC
- Message-ID
- <AANLkTim2F1B7=Q5wTfxxWod3yyyiMuGxKnEGNyCVjcuZ@mail.gmail.com>
- In-Reply-To
- <20110213193534.GA2437@khazad-dum.debian.net>
Hi,
On 13 February 2011 19:35, Henrique de Moraes Holschuh <hmh@hmh.eng.br> wrote:
Show 19 quoted lines
> Here is a testcase to reproduce the problem: > > $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/longterm/linux-2.6.27.y.git > $ cd linux-2.6.27.y > $ git reset --hard v2.6.27.53 > $ stg init > $ stg new test-patch-1 > $ echo "something" > changedfile > $ git add changedfile > $ stg refresh > > $ stg rebase v2.6.27.58 > > Checking for changes in the working directory ... done > Popping all applied patches ... done > Rebasing to "v2.6.27.58" ... done > Pushing patch "test-patch-1" ... done > Now at patch "test-patch-1" > Traceback (most recent call last):
[...]
> File "/usr/lib/pymodules/python2.6/stgit/lib/git.py", line 408, in parse > assert False > AssertionError
StGit is parsing the commit information for some key/value pairs. It looks like it found one which it didn't know about - "encoding: latin1" and it failed.
For now it is OK to just remove the assert. The drawback is that if you do some "stg uncommit" on some existing commits, it will lose additional information but I don't think it matters to you since you create your patches with StGit anyway and it doesn't generate such information. Longer term we may want to preserve other things that may appear in the commit data. I'll push this to the StGit repository as well.
diff --git a/stgit/lib/git.py b/stgit/lib/git.py index 3378728..f5ea965 100644 --- a/stgit/lib/git.py +++ b/stgit/lib/git.py @@ -404,8 +404,6 @@ class CommitData(Immutable, Repr): cd = cd.set_author(Person.parse(value)) elif key == 'committer': cd = cd.set_committer(Person.parse(value)) - else: - assert False assert False class Commit(GitObject): Thanks.
-- Catalin