{"thread":{"id":"12095","subject":"[PATCH 3/5] Include the fast-import marks table in crash reports","startedAt":"2008-02-14T06:34:40Z","lastAt":"2008-02-14T06:34:40Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"68717","messageId":"20080214063440.GC30678@spearce.org","threadId":"12095","inReplyTo":null,"subject":"[PATCH 3/5] Include the fast-import marks table in crash reports","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-14T06:34:40Z","receivedAt":"2008-02-14T06:34:40Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"If fast-import was not run with --export-marks but we are crashing\nthe frontend application developer may still benefit from having\nthat information available to them.  We now include the marks table\nas part of the crash report if --export-marks was not supplied on\nthe command line.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n fast-import.c |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 8ef607f..117f38c 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -372,6 +372,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)\n \tfputc('\\n', rpt);\n }\n \n+static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);\n+\n static void write_crash_report(const char *err)\n {\n \tchar *loc = git_path(\"fast_import_crash_%d\", getpid());\n@@ -444,6 +446,14 @@ static void write_crash_report(const char *err)\n \t}\n \n \tfputc('\\n', rpt);\n+\tfputs(\"Marks\\n\", rpt);\n+\tfputs(\"-----\\n\", rpt);\n+\tif (mark_file)\n+\t\tfprintf(rpt, \"  exported to %s\\n\", mark_file);\n+\telse\n+\t\tdump_marks_helper(rpt, 0, marks);\n+\n+\tfputc('\\n', rpt);\n \tfputs(\"-------------------\\n\", rpt);\n \tfputs(\"END OF CRASH REPORT\\n\", rpt);\n \tfclose(rpt);\n-- \n1.5.4.1.1309.g833c2\n"}]}