Skip to content

Commit 3b08e5b

Browse files
spearcegitster
authored andcommitted
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>
1 parent fbc63ea commit 3b08e5b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fast-import.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)
372372
fputc('\n', rpt);
373373
}
374374

375+
static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);
376+
375377
static void write_crash_report(const char *err)
376378
{
377379
char *loc = git_path("fast_import_crash_%d", getpid());
@@ -443,6 +445,14 @@ static void write_crash_report(const char *err)
443445
}
444446
}
445447

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+
446456
fputc('\n', rpt);
447457
fputs("-------------------\n", rpt);
448458
fputs("END OF CRASH REPORT\n", rpt);

0 commit comments

Comments
 (0)