{"thread":{"id":"12093","subject":"[PATCH 5/5] Update fast-import documentation to discuss crash reports","startedAt":"2008-02-14T06:34:46Z","lastAt":"2008-02-14T06:34:46Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"68715","messageId":"20080214063446.GE30678@spearce.org","threadId":"12093","inReplyTo":null,"subject":"[PATCH 5/5] Update fast-import documentation to discuss crash reports","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-14T06:34:46Z","receivedAt":"2008-02-14T06:34:46Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Recent versions of fast-import will now dump information out upon\ncrashing, making it possible for the frontend developer to review\nsome state information and possibly restart the import from the\npoint where it crashed.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Documentation/git-fast-import.txt |   87 +++++++++++++++++++++++++++++++++++++\n 1 files changed, 87 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt\nindex bd625ab..96f6767 100644\n--- a/Documentation/git-fast-import.txt\n+++ b/Documentation/git-fast-import.txt\n@@ -805,6 +805,93 @@ Placing a `progress` command immediately after a `checkpoint` will\n inform the reader when the `checkpoint` has been completed and it\n can safely access the refs that fast-import updated.\n \n+Crash Reports\n+-------------\n+If fast-import is supplied invalid input it will terminate with a\n+non-zero exit status and create a crash report in the top level of\n+the Git repository it was importing into.  Crash reports contain\n+a snapshot of the internal fast-import state as well as the most\n+recent commands that lead up to the crash.\n+\n+All recent commands (including stream comments, file changes and\n+progress commands) are shown in the command history within the crash\n+report, but raw file data and commit messages are excluded from the\n+crash report.  This exclusion saves space within the report file\n+and reduces the amount of buffering that fast-import must perform\n+during execution.\n+\n+After writing a crash report fast-import will close the current\n+packfile and export the marks table.  This allows the frontend\n+developer to inspect the repository state and resume the import from\n+the point where it crashed.  The modified branches and tags are not\n+updated during a crash, as the import did not complete successfully.\n+Branch and tag information can be found in the crash report and\n+must be applied manually if the update is needed.\n+\n+An example crash:\n+\n+====\n+\t$ cat >in <<END_OF_INPUT\n+\t# my very first test commit\n+\tcommit refs/heads/master\n+\tcommitter Shawn O. Pearce <spearce> 19283 -0400\n+\t# who is that guy anyway?\n+\tdata <<EOF\n+\tthis is my commit\n+\tEOF\n+\tM 644 inline .gitignore\n+\tdata <<EOF\n+\t.gitignore\n+\tEOF\n+\tM 777 inline bob\n+\tEND_OF_INPUT\n+\n+\t$ git-fast-import <in\n+\tfatal: Corrupt mode: M 777 inline bob\n+\tfast-import: dumping crash report to .git/fast_import_crash_8434\n+\n+\t$ cat .git/fast_import_crash_8434\n+\tfast-import crash report:\n+\t    fast-import process: 8434\n+\t    parent process     : 1391\n+\t    at Sat Sep 1 00:58:12 2007\n+\n+\tfatal: Corrupt mode: M 777 inline bob\n+\n+\tMost Recent Commands Before Crash\n+\t---------------------------------\n+\t  # my very first test commit\n+\t  commit refs/heads/master\n+\t  committer Shawn O. Pearce <spearce> 19283 -0400\n+\t  # who is that guy anyway?\n+\t  data <<EOF\n+\t  M 644 inline .gitignore\n+\t  data <<EOF\n+\t* M 777 inline bob\n+\n+\tActive Branch LRU\n+\t-----------------\n+\t    active_branches = 1 cur, 5 max\n+\n+\t  pos  clock name\n+\t  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\t   1)      0 refs/heads/master\n+\n+\tInactive Branches\n+\t-----------------\n+\trefs/heads/master:\n+\t  status      : active loaded dirty\n+\t  tip commit  : 0000000000000000000000000000000000000000\n+\t  old tree    : 0000000000000000000000000000000000000000\n+\t  cur tree    : 0000000000000000000000000000000000000000\n+\t  commit clock: 0\n+\t  last pack   :\n+\n+\n+\t-------------------\n+\tEND OF CRASH REPORT\n+====\n+\n Tips and Tricks\n ---------------\n The following tips and tricks have been collected from various\n-- \n1.5.4.1.1309.g833c2\n"}]}