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

Re: AssertionError in "stg uncommit" when going too far back

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Mar 8, 2008, 12:19 UTC
Message-ID
<b0943d9e0803080419y6373ce62xfb108a15203858c7@mail.gmail.com>
In-Reply-To
<1204753622.17845.16.camel@dv>
On 05/03/2008, Pavel Roskin <proski@gnu.org> wrote:
Show 10 quoted lines
> "stg uncommit" causes AssertionError if the number commits to uncommit it too large:
>
> $ stg uncommit -n 10000
> Uncommitting 10000 patches ... Traceback (most recent call last):
>  File "/home/proski/bin/stg", line 43, in <module>
>    main()
>  File "home/proski/lib/python2.5/site-packages/stgit/main.py", line 278, in main
>  File "home/proski/lib/python2.5/site-packages/stgit/commands/uncommit.py", line 94, in func
>  File "home/proski/lib/python2.5/site-packages/stgit/lib/git.py", line 171, in parent
> AssertionError

That's on the master branch. I think on the stable one, it used to report a message like "Commit doesn't have exactly one parent".

In the latest version, we should indeed raise an exception rather than just assert. I wouldn't declare a new exception class but rather use an existing one with a meaningful error message. We can't recover from this anyway and we would simply cancel the operation. I'll let Karl comment on this as well.

Thanks for reporting it.
-- 
Catalin
Previous: Pavel Roskin
Message 2 of 2 in “AssertionError in "stg uncommit" when going too far back”
  1. Pavel RoskinMar 5, 2008
  2. Catalin MarinasMar 8, 2008

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.