@matheusbsbs / matheus-bagliano / commits / 3b08e5b8c9
Fork 0

Include the fast-import marks table in crash reports

If fast-import was not run with --export-marks but we are crashing the frontend application developer may still benefit from having that information available to them. We now include the marks table as part of the crash report if --export-marks was not supplied on the command line. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shawn O. Pearce committed Feb 14, 2008 at 01:34 UTC 3b08e5b8c9130f57a38e51557dbb173b9edda5ba
1 file changed +10
fast-import.c
+10
@@ -372,6 +372,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)
372 fputc('\n', rpt);
373 }
374
375 +static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);
376 +
377 static void write_crash_report(const char *err)
378 {
379 char *loc = git_path("fast_import_crash_%d", getpid());
@@ -443,6 +445,14 @@ static void write_crash_report(const char *err)
445 }
446 }
447
448 + fputc('\n', rpt);
449 + fputs("Marks\n", rpt);
450 + fputs("-----\n", rpt);
451 + if (mark_file)
452 + fprintf(rpt, " exported to %s\n", mark_file);
453 + else
454 + dump_marks_helper(rpt, 0, marks);
455 +
456 fputc('\n', rpt);
457 fputs("-------------------\n", rpt);
458 fputs("END OF CRASH REPORT\n", rpt);