Skip to content

Commit

Permalink
Include the fast-import marks table in crash reports
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Feb 16, 2008
1 parent fbc63ea commit 3b08e5b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)
fputc('\n', rpt);
}

static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);

static void write_crash_report(const char *err)
{
char *loc = git_path("fast_import_crash_%d", getpid());
Expand Down Expand Up @@ -443,6 +445,14 @@ static void write_crash_report(const char *err)
}
}

fputc('\n', rpt);
fputs("Marks\n", rpt);
fputs("-----\n", rpt);
if (mark_file)
fprintf(rpt, " exported to %s\n", mark_file);
else
dump_marks_helper(rpt, 0, marks);

fputc('\n', rpt);
fputs("-------------------\n", rpt);
fputs("END OF CRASH REPORT\n", rpt);
Expand Down

0 comments on commit 3b08e5b

Please sign in to comment.