{"thread":{"id":"11284","subject":"[StGit PATCH 0/5] Various odds and ends","startedAt":"2007-12-14T06:24:53Z","lastAt":"2007-12-14T06:45:53Z","messageCount":8,"participants":["Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"63096","messageId":"20071214062251.29148.86191.stgit@yoghurt","threadId":"11284","inReplyTo":null,"subject":"[StGit PATCH 0/5] Various odds and ends","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:24:53Z","receivedAt":"2007-12-14T06:24:53Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Also available from\n\n  git://repo.or.cz/stgit/kha.git safe\n\n---\n\nDavid Kågedal (2):\n      Treat filename '-' as stdin/stdout in edit\n      Added --save-template flag to edit command\n\nKarl Hasselström (3):\n      Name the exit codes to improve legibility\n      Make generic --message/--file/--save-template flags\n      Let parse_patch take a string instead of a file parameter\n\n\n stgit/commands/common.py |    6 ++--\n stgit/commands/edit.py   |   73 +++++++++++++++++++++++-----------------------\n stgit/commands/imprt.py  |    2 +\n stgit/main.py            |   25 ++++++++--------\n stgit/utils.py           |   50 ++++++++++++++++++++++++++++++++\n 5 files changed, 103 insertions(+), 53 deletions(-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63097","messageId":"20071214062503.29148.84674.stgit@yoghurt","threadId":"11284","inReplyTo":"20071214062251.29148.86191.stgit@yoghurt","subject":"[StGit PATCH 1/5] Added --save-template flag to edit command","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:25:03Z","receivedAt":"2007-12-14T06:25:03Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: David Kågedal <davidk@lysator.liu.se>\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/edit.py |   21 +++++++++++++++------\n 1 files changed, 15 insertions(+), 6 deletions(-)\n\n\ndiff --git a/stgit/commands/edit.py b/stgit/commands/edit.py\nindex a4d8f96..ec2c4ae 100644\n--- a/stgit/commands/edit.py\n+++ b/stgit/commands/edit.py\n@@ -72,6 +72,8 @@ options = [make_option('-d', '--diff',\n                        help = 'annotate the patch log entry'),\n            make_option('-m', '--message',\n                        help = 'replace the patch description with MESSAGE'),\n+           make_option('--save-template', metavar = 'FILE',\n+                       help = 'save the patch to FILE in the format used by -f'),\n            make_option('--author', metavar = '\"NAME <EMAIL>\"',\n                        help = 'replae the author details with \"NAME <EMAIL>\"'),\n            make_option('--authname',\n@@ -120,8 +122,8 @@ def __update_patch(pname, fname, options):\n     else:\n         out.done()\n \n-def __edit_update_patch(pname, options):\n-    \"\"\"Edit the given patch interactively.\n+def __generate_file(pname, fname, options):\n+    \"\"\"Generate a file containing the description to edit\n     \"\"\"\n     patch = crt_series.get_patch(pname)\n \n@@ -168,15 +170,20 @@ def __edit_update_patch(pname, options):\n \n     text = tmpl % tmpl_dict\n \n+    # write the file to be edited\n+    f = open(fname, 'w+')\n+    f.write(text)\n+    f.close()\n+\n+def __edit_update_patch(pname, options):\n+    \"\"\"Edit the given patch interactively.\n+    \"\"\"\n     if options.diff:\n         fname = '.stgit-edit.diff'\n     else:\n         fname = '.stgit-edit.txt'\n \n-    # write the file to be edited\n-    f = open(fname, 'w+')\n-    f.write(text)\n-    f.close()\n+    __generate_file(pname, fname, options)\n \n     # invoke the editor\n     call_editor(fname)\n@@ -233,6 +240,8 @@ def func(parser, options, args):\n                                  log = 'edit',\n                                  notes = options.annotate)\n         out.done()\n+    elif options.save_template:\n+        __generate_file(pname, options.save_template, options)\n     elif options.file:\n         __update_patch(pname, options.file, options)\n     else:\n"},{"id":"63098","messageId":"20071214062509.29148.23933.stgit@yoghurt","threadId":"11284","inReplyTo":"20071214062251.29148.86191.stgit@yoghurt","subject":"[StGit PATCH 2/5] Treat filename '-' as stdin/stdout in edit","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:25:09Z","receivedAt":"2007-12-14T06:25:09Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: David Kågedal <davidk@lysator.liu.se>\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/edit.py |   14 ++++++++++----\n 1 files changed, 10 insertions(+), 4 deletions(-)\n\n\ndiff --git a/stgit/commands/edit.py b/stgit/commands/edit.py\nindex ec2c4ae..4d1475f 100644\n--- a/stgit/commands/edit.py\n+++ b/stgit/commands/edit.py\n@@ -96,7 +96,10 @@ def __update_patch(pname, fname, options):\n     bottom = patch.get_bottom()\n     top = patch.get_top()\n \n-    f = open(fname)\n+    if fname == '-':\n+        f = sys.stdin\n+    else:\n+        f = open(fname)\n     message, author_name, author_email, author_date, diff = parse_patch(f)\n     f.close()\n \n@@ -171,9 +174,12 @@ def __generate_file(pname, fname, options):\n     text = tmpl % tmpl_dict\n \n     # write the file to be edited\n-    f = open(fname, 'w+')\n-    f.write(text)\n-    f.close()\n+    if fname == '-':\n+        sys.stdout.write(text)\n+    else:\n+        f = open(fname, 'w+')\n+        f.write(text)\n+        f.close()\n \n def __edit_update_patch(pname, options):\n     \"\"\"Edit the given patch interactively.\n"},{"id":"63100","messageId":"20071214062515.29148.4402.stgit@yoghurt","threadId":"11284","inReplyTo":"20071214062251.29148.86191.stgit@yoghurt","subject":"[StGit PATCH 3/5] Let parse_patch take a string instead of a file parameter","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:25:15Z","receivedAt":"2007-12-14T06:25:15Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This makes it more generally useful, since all future callers may not\nhave the input in a file.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/common.py |    6 +++---\n stgit/commands/edit.py   |    3 ++-\n stgit/commands/imprt.py  |    2 +-\n 3 files changed, 6 insertions(+), 5 deletions(-)\n\n\ndiff --git a/stgit/commands/common.py b/stgit/commands/common.py\nindex 3840387..7cf700e 100644\n--- a/stgit/commands/common.py\n+++ b/stgit/commands/common.py\n@@ -482,11 +482,11 @@ def parse_mail(msg):\n \n     return (descr, authname, authemail, authdate, diff)\n \n-def parse_patch(fobj):\n-    \"\"\"Parse the input file and return (description, authname,\n+def parse_patch(text):\n+    \"\"\"Parse the input text and return (description, authname,\n     authemail, authdate, diff)\n     \"\"\"\n-    descr, diff = __split_descr_diff(fobj.read())\n+    descr, diff = __split_descr_diff(text)\n     descr, authname, authemail, authdate = __parse_description(descr)\n \n     # we don't yet have an agreed place for the creation date.\ndiff --git a/stgit/commands/edit.py b/stgit/commands/edit.py\nindex 4d1475f..65b54d9 100644\n--- a/stgit/commands/edit.py\n+++ b/stgit/commands/edit.py\n@@ -100,7 +100,8 @@ def __update_patch(pname, fname, options):\n         f = sys.stdin\n     else:\n         f = open(fname)\n-    message, author_name, author_email, author_date, diff = parse_patch(f)\n+    (message, author_name, author_email, author_date, diff\n+     ) = parse_patch(f.read())\n     f.close()\n \n     out.start('Updating patch \"%s\"' % pname)\ndiff --git a/stgit/commands/imprt.py b/stgit/commands/imprt.py\nindex 1c21a74..4a4b792 100644\n--- a/stgit/commands/imprt.py\n+++ b/stgit/commands/imprt.py\n@@ -192,7 +192,7 @@ def __import_file(filename, options, patch = None):\n                  parse_mail(msg)\n     else:\n         message, author_name, author_email, author_date, diff = \\\n-                 parse_patch(f)\n+                 parse_patch(f.read())\n \n     if filename:\n         f.close()\n"},{"id":"63099","messageId":"20071214062521.29148.66456.stgit@yoghurt","threadId":"11284","inReplyTo":"20071214062251.29148.86191.stgit@yoghurt","subject":"[StGit PATCH 4/5] Make generic --message/--file/--save-template flags","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:25:21Z","receivedAt":"2007-12-14T06:25:21Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"And let \"stg edit\" use them.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/edit.py |   77 +++++++++++++++++++-----------------------------\n stgit/utils.py         |   45 ++++++++++++++++++++++++++++\n 2 files changed, 75 insertions(+), 47 deletions(-)\n\n\ndiff --git a/stgit/commands/edit.py b/stgit/commands/edit.py\nindex 65b54d9..b9699d5 100644\n--- a/stgit/commands/edit.py\n+++ b/stgit/commands/edit.py\n@@ -61,8 +61,6 @@ directory = DirectoryGotoToplevel()\n options = [make_option('-d', '--diff',\n                        help = 'edit the patch diff',\n                        action = 'store_true'),\n-           make_option('-f', '--file',\n-                       help = 'use FILE instead of invoking the editor'),\n            make_option('-O', '--diff-opts',\n                        help = 'options to pass to git-diff'),\n            make_option('--undo',\n@@ -70,10 +68,6 @@ options = [make_option('-d', '--diff',\n                        action = 'store_true'),\n            make_option('-a', '--annotate', metavar = 'NOTE',\n                        help = 'annotate the patch log entry'),\n-           make_option('-m', '--message',\n-                       help = 'replace the patch description with MESSAGE'),\n-           make_option('--save-template', metavar = 'FILE',\n-                       help = 'save the patch to FILE in the format used by -f'),\n            make_option('--author', metavar = '\"NAME <EMAIL>\"',\n                        help = 'replae the author details with \"NAME <EMAIL>\"'),\n            make_option('--authname',\n@@ -86,47 +80,48 @@ options = [make_option('-d', '--diff',\n                        help = 'replace the committer name with COMMNAME'),\n            make_option('--commemail',\n                        help = 'replace the committer e-mail with COMMEMAIL')\n-           ] + make_sign_options()\n+           ] + make_sign_options() + make_message_options()\n \n-def __update_patch(pname, fname, options):\n-    \"\"\"Update the current patch from the given file.\n+def __update_patch(pname, text, options):\n+    \"\"\"Update the current patch from the given text.\n     \"\"\"\n     patch = crt_series.get_patch(pname)\n \n     bottom = patch.get_bottom()\n     top = patch.get_top()\n \n-    if fname == '-':\n-        f = sys.stdin\n-    else:\n-        f = open(fname)\n-    (message, author_name, author_email, author_date, diff\n-     ) = parse_patch(f.read())\n-    f.close()\n+    message, author_name, author_email, author_date, diff = parse_patch(text)\n \n     out.start('Updating patch \"%s\"' % pname)\n \n     if options.diff:\n         git.switch(bottom)\n         try:\n-            git.apply_patch(fname)\n+            git.apply_patch(diff = diff)\n         except:\n             # avoid inconsistent repository state\n             git.switch(top)\n             raise\n \n+    def c(a, b):\n+        if a != None:\n+            return a\n+        return b\n     crt_series.refresh_patch(message = message,\n-                             author_name = author_name,\n-                             author_email = author_email,\n-                             author_date = author_date,\n-                             backup = True, log = 'edit')\n+                             author_name = c(options.authname, author_name),\n+                             author_email = c(options.authemail, author_email),\n+                             author_date = c(options.authdate, author_date),\n+                             committer_name = options.commname,\n+                             committer_email = options.commemail,\n+                             backup = True, sign_str = options.sign_str,\n+                             log = 'edit', notes = options.annotate)\n \n     if crt_series.empty_patch(pname):\n         out.done('empty patch')\n     else:\n         out.done()\n \n-def __generate_file(pname, fname, options):\n+def __generate_file(pname, write_fn, options):\n     \"\"\"Generate a file containing the description to edit\n     \"\"\"\n     patch = crt_series.get_patch(pname)\n@@ -175,12 +170,7 @@ def __generate_file(pname, fname, options):\n     text = tmpl % tmpl_dict\n \n     # write the file to be edited\n-    if fname == '-':\n-        sys.stdout.write(text)\n-    else:\n-        f = open(fname, 'w+')\n-        f.write(text)\n-        f.close()\n+    write_fn(text)\n \n def __edit_update_patch(pname, options):\n     \"\"\"Edit the given patch interactively.\n@@ -189,13 +179,17 @@ def __edit_update_patch(pname, options):\n         fname = '.stgit-edit.diff'\n     else:\n         fname = '.stgit-edit.txt'\n+    def write_fn(text):\n+        f = file(fname, 'w')\n+        f.write(text)\n+        f.close()\n \n-    __generate_file(pname, fname, options)\n+    __generate_file(pname, write_fn, options)\n \n     # invoke the editor\n     call_editor(fname)\n \n-    __update_patch(pname, fname, options)\n+    __update_patch(pname, file(fname).read(), options)\n \n def func(parser, options, args):\n     \"\"\"Edit the given patch or the current one.\n@@ -232,25 +226,14 @@ def func(parser, options, args):\n         out.start('Undoing the editing of \"%s\"' % pname)\n         crt_series.undo_refresh()\n         out.done()\n-    elif options.message or options.authname or options.authemail \\\n-             or options.authdate or options.commname or options.commemail \\\n-             or options.sign_str:\n-        # just refresh the patch with the given information\n-        out.start('Updating patch \"%s\"' % pname)\n-        crt_series.refresh_patch(message = options.message,\n-                                 author_name = options.authname,\n-                                 author_email = options.authemail,\n-                                 author_date = options.authdate,\n-                                 committer_name = options.commname,\n-                                 committer_email = options.commemail,\n-                                 backup = True, sign_str = options.sign_str,\n-                                 log = 'edit',\n-                                 notes = options.annotate)\n-        out.done()\n     elif options.save_template:\n         __generate_file(pname, options.save_template, options)\n-    elif options.file:\n-        __update_patch(pname, options.file, options)\n+    elif any([options.message, options.authname, options.authemail,\n+              options.authdate, options.commname, options.commemail,\n+              options.sign_str]):\n+        out.start('Updating patch \"%s\"' % pname)\n+        __update_patch(pname, options.message, options)\n+        out.done()\n     else:\n         __edit_update_patch(pname, options)\n \ndiff --git a/stgit/utils.py b/stgit/utils.py\nindex 3a480c0..837c6c2 100644\n--- a/stgit/utils.py\n+++ b/stgit/utils.py\n@@ -256,3 +256,48 @@ def add_sign_line(desc, sign_str, name, email):\n     if not any(s in desc for s in ['\\nSigned-off-by:', '\\nAcked-by:']):\n         desc = desc + '\\n'\n     return '%s\\n%s\\n' % (desc, sign_str)\n+\n+def make_message_options():\n+    def no_dup(parser):\n+        if parser.values.message != None:\n+            raise optparse.OptionValueError(\n+                'Cannot give more than one --message or --file')\n+    def no_combine(parser):\n+        if (parser.values.message != None\n+            and parser.values.save_template != None):\n+            raise optparse.OptionValueError(\n+                'Cannot give both --message/--file and --save-template')\n+    def msg_callback(option, opt_str, value, parser):\n+        no_dup(parser)\n+        parser.values.message = value\n+        no_combine(parser)\n+    def file_callback(option, opt_str, value, parser):\n+        no_dup(parser)\n+        if value == '-':\n+            parser.values.message = sys.stdin.read()\n+        else:\n+            f = file(value)\n+            parser.values.message = f.read()\n+            f.close()\n+        no_combine(parser)\n+    def templ_callback(option, opt_str, value, parser):\n+        if value == '-':\n+            def w(s):\n+                sys.stdout.write(s)\n+        else:\n+            def w(s):\n+                f = file(value, 'w+')\n+                f.write(s)\n+                f.close()\n+        parser.values.save_template = w\n+        no_combine(parser)\n+    m = optparse.make_option\n+    return [m('-m', '--message', action = 'callback', callback = msg_callback,\n+              dest = 'message', type = 'string',\n+              help = 'use MESSAGE instead of invoking the editor'),\n+            m('-f', '--file', action = 'callback', callback = file_callback,\n+              dest = 'message', type = 'string', metavar = 'FILE',\n+              help = 'use FILE instead of invoking the editor'),\n+            m('--save-template', action = 'callback', callback = templ_callback,\n+              metavar = 'FILE', dest = 'save_template', type = 'string',\n+              help = 'save the message template to FILE and exit')]\n"},{"id":"63101","messageId":"20071214062527.29148.7928.stgit@yoghurt","threadId":"11284","inReplyTo":"20071214062251.29148.86191.stgit@yoghurt","subject":"[StGit PATCH 5/5] Name the exit codes to improve legibility","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:25:27Z","receivedAt":"2007-12-14T06:25:27Z","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 stgit/main.py  |   25 +++++++++++++------------\n stgit/utils.py |    5 +++++\n 2 files changed, 18 insertions(+), 12 deletions(-)\n\n\ndiff --git a/stgit/main.py b/stgit/main.py\nindex a03447f..95e25f8 100644\n--- a/stgit/main.py\n+++ b/stgit/main.py\n@@ -23,6 +23,7 @@ from optparse import OptionParser\n \n import stgit.commands\n from stgit.out import *\n+from stgit import utils\n \n #\n # The commands map\n@@ -39,11 +40,11 @@ class Commands(dict):\n         if not candidates:\n             out.error('Unknown command: %s' % key,\n                       'Try \"%s help\" for a list of supported commands' % prog)\n-            sys.exit(1)\n+            sys.exit(utils.STGIT_GENERAL_ERROR)\n         elif len(candidates) > 1:\n             out.error('Ambiguous command: %s' % key,\n                       'Candidates are: %s' % ', '.join(candidates))\n-            sys.exit(1)\n+            sys.exit(utils.STGIT_GENERAL_ERROR)\n \n         return candidates[0]\n         \n@@ -206,7 +207,7 @@ def main():\n         print >> sys.stderr, 'usage: %s <command>' % prog\n         print >> sys.stderr, \\\n               '  Try \"%s --help\" for a list of supported commands' % prog\n-        sys.exit(1)\n+        sys.exit(utils.STGIT_GENERAL_ERROR)\n \n     cmd = sys.argv[1]\n \n@@ -216,13 +217,13 @@ def main():\n             sys.argv[2] = '--help'\n         else:\n             print_help()\n-            sys.exit(0)\n+            sys.exit(utils.STGIT_SUCCESS)\n     if cmd == 'help':\n         if len(sys.argv) == 3 and not sys.argv[2] in ['-h', '--help']:\n             cmd = commands.canonical_cmd(sys.argv[2])\n             if not cmd in commands:\n                 out.error('%s help: \"%s\" command unknown' % (prog, cmd))\n-                sys.exit(1)\n+                sys.exit(utils.STGIT_GENERAL_ERROR)\n \n             sys.argv[0] += ' %s' % cmd\n             command = commands[cmd]\n@@ -232,16 +233,16 @@ def main():\n             pager(parser.format_help())\n         else:\n             print_help()\n-        sys.exit(0)\n+        sys.exit(utils.STGIT_SUCCESS)\n     if cmd in ['-v', '--version', 'version']:\n         from stgit.version import version\n         print 'Stacked GIT %s' % version\n         os.system('git --version')\n         print 'Python version %s' % sys.version\n-        sys.exit(0)\n+        sys.exit(utils.STGIT_SUCCESS)\n     if cmd in ['copyright']:\n         print __copyright__\n-        sys.exit(0)\n+        sys.exit(utils.STGIT_SUCCESS)\n \n     # re-build the command line arguments\n     cmd = commands.canonical_cmd(cmd)\n@@ -265,7 +266,7 @@ def main():\n         debug_level = int(os.environ.get('STGIT_DEBUG_LEVEL', 0))\n     except ValueError:\n         out.error('Invalid STGIT_DEBUG_LEVEL environment variable')\n-        sys.exit(1)\n+        sys.exit(utils.STGIT_GENERAL_ERROR)\n \n     try:\n         directory.setup()\n@@ -284,8 +285,8 @@ def main():\n         if debug_level > 0:\n             raise\n         else:\n-            sys.exit(2)\n+            sys.exit(utils.STGIT_COMMAND_ERROR)\n     except KeyboardInterrupt:\n-        sys.exit(1)\n+        sys.exit(utils.STGIT_GENERAL_ERROR)\n \n-    sys.exit(0)\n+    sys.exit(utils.STGIT_SUCCESS)\ndiff --git a/stgit/utils.py b/stgit/utils.py\nindex 837c6c2..29a5f63 100644\n--- a/stgit/utils.py\n+++ b/stgit/utils.py\n@@ -301,3 +301,8 @@ def make_message_options():\n             m('--save-template', action = 'callback', callback = templ_callback,\n               metavar = 'FILE', dest = 'save_template', type = 'string',\n               help = 'save the message template to FILE and exit')]\n+\n+# Exit codes.\n+STGIT_SUCCESS = 0        # everything's OK\n+STGIT_GENERAL_ERROR = 1  # seems to be non-command-specific error\n+STGIT_COMMAND_ERROR = 2  # seems to be a command that failed\n"},{"id":"63109","messageId":"20071214064450.GA10278@diana.vm.bytemark.co.uk","threadId":"11284","inReplyTo":"20071214062521.29148.66456.stgit@yoghurt","subject":"Re: [StGit PATCH 4/5] Make generic --message/--file/--save-template flags","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:44:50Z","receivedAt":"2007-12-14T06:44:50Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-14 07:25:21 +0100, Karl Hasselström wrote:\n\n> And let \"stg edit\" use them.\n\nNothing else in the \"safe\" branch uses this currently. But one of the\n\"experimental\" patches I just sent out does.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63110","messageId":"20071214064553.GB10278@diana.vm.bytemark.co.uk","threadId":"11284","inReplyTo":"20071214062527.29148.7928.stgit@yoghurt","subject":"Re: [StGit PATCH 5/5] Name the exit codes to improve legibility","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-14T06:45:53Z","receivedAt":"2007-12-14T06:45:53Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-14 07:25:27 +0100, Karl Hasselström wrote:\n\n> +# Exit codes.\n> +STGIT_SUCCESS = 0        # everything's OK\n> +STGIT_GENERAL_ERROR = 1  # seems to be non-command-specific error\n> +STGIT_COMMAND_ERROR = 2  # seems to be a command that failed\n\nIf anyone knows for sure, feel free to fix up these descriptions.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}