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

[PATCH 2/5] Exit with status code 2 if we get an exception.

From
Fredrik Kuivinen <freku045@student.liu.se>
Date
Sep 12, 2005, 21:29 UTC
Message-ID
<20050912212954.GD6644@c165.ib.student.liu.se>
In-Reply-To
<20050912212601.GB6644@c165.ib.student.liu.se>
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
---
 git-merge-fredrik.py |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
f814a54ac034f4455363582b2c2f3d386bf8f0be
diff --git a/git-merge-fredrik.py b/git-merge-fredrik.py
--- a/git-merge-fredrik.py
+++ b/git-merge-fredrik.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import sys, math, random, os, re, signal, tempfile, stat, errno
+import sys, math, random, os, re, signal, tempfile, stat, errno, traceback
 from heapq import heappush, heappop
 from sets import Set
 
@@ -409,15 +409,20 @@ for nextArg in xrange(1, len(sys.argv)):
         break
 
 print 'Merging', h1, 'with', h2
-h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
-h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()
 
-graph = buildGraph([h1, h2])
-
-[res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
-                     firstBranch, secondBranch, graph)
-
-print ''
+try:
+    h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
+    h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()
+
+    graph = buildGraph([h1, h2])
+
+    [res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
+                         firstBranch, secondBranch, graph)
+
+    print ''
+except:
+    traceback.print_exc(None, sys.stderr)
+    sys.exit(2)
 
 if clean:
     sys.exit(0)
Previous: Fredrik KuivinenNext: Fredrik Kuivinen
Message 3 of 8 in “git-merge-fredrik updates”
  1. 0/5 git-merge-fredrik updatesFredrik Kuivinen, Sep 12, 2005
  2. 1/5 Fix assertion failure when merging common ancestors.Fredrik Kuivinen, Sep 12, 2005
  3. 2/5 Exit with status code 2 if we get an exception.Fredrik Kuivinen, Sep 12, 2005
  4. 3/5 Introduce a 'die' function.Fredrik Kuivinen, Sep 12, 2005
  5. 4/5 Make sure we die if we don't get enough arguments.Fredrik Kuivinen, Sep 12, 2005
  6. 5/5 Make the ProgramError class printable.Fredrik Kuivinen, Sep 12, 2005
  7. Junio C HamanoSep 12, 2005
  8. Rename the 'fredrik' merge strategy to 'recursive'.Fredrik Kuivinen, Sep 13, 2005

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.