{"thread":{"id":"35180","subject":"[PATCH] Catch more exceptions in compat_log_entry()","startedAt":"2013-10-22T14:31:26Z","lastAt":"2013-11-06T10:27:49Z","messageCount":2,"participants":["Pavel Roskin","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"229289","messageId":"20131022143126.11775.85272.stgit@IRBT4585","threadId":"35180","inReplyTo":null,"subject":"[PATCH] Catch more exceptions in compat_log_entry()","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2013-10-22T14:31:26Z","receivedAt":"2013-10-22T14:31:26Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Catch exceptions in default_repo().  Catch git.RepositoryException.\nThis suppresses stack trace in \"stg pull\" on detached head and outside\nthe repository.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n stgit/lib/log.py |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/lib/log.py b/stgit/lib/log.py\nindex dfadd51..d876ff6 100644\n--- a/stgit/lib/log.py\n+++ b/stgit/lib/log.py\n@@ -359,10 +359,10 @@ class Fakestack(object):\n def compat_log_entry(msg):\n     \"\"\"Write a new log entry. (Convenience function intended for use by\n     code not yet converted to the new infrastructure.)\"\"\"\n-    repo = default_repo()\n     try:\n+        repo = default_repo()\n         stack = repo.get_stack(repo.current_branch_name)\n-    except libstack.StackException, e:\n+    except (libstack.StackException, git.RepositoryException), e:\n         out.warn(str(e), 'Could not write to stack log')\n     else:\n         if repo.default_index.conflicts() and stack.patchorder.applied:\n"},{"id":"230137","messageId":"CAHkRjk5g-UKDN5by0+0xHZBAH8=bhP8yoiGbm1Zdd6L1rQ3Ogg@mail.gmail.com","threadId":"35180","inReplyTo":"20131022143126.11775.85272.stgit@IRBT4585","subject":"Re: [PATCH] Catch more exceptions in compat_log_entry()","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2013-11-06T10:27:49Z","receivedAt":"2013-11-06T10:27:49Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 22 October 2013 15:31, Pavel Roskin <proski@gnu.org> wrote:\n> Catch exceptions in default_repo().  Catch git.RepositoryException.\n> This suppresses stack trace in \"stg pull\" on detached head and outside\n> the repository.\n>\n> Signed-off-by: Pavel Roskin <proski@gnu.org>\n\nThanks. Applied.\n\nCatalin\n"}]}