Skip to content

Commit e7e5170

Browse files
spearcegitster
authored andcommitted
Update fast-import documentation to discuss crash reports
Recent versions of fast-import will now dump information out upon crashing, making it possible for the frontend developer to review some state information and possibly restart the import from the point where it crashed. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 118805b commit e7e5170

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

Documentation/git-fast-import.txt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,93 @@ Placing a `progress` command immediately after a `checkpoint` will
805805
inform the reader when the `checkpoint` has been completed and it
806806
can safely access the refs that fast-import updated.
807807

808+
Crash Reports
809+
-------------
810+
If fast-import is supplied invalid input it will terminate with a
811+
non-zero exit status and create a crash report in the top level of
812+
the Git repository it was importing into. Crash reports contain
813+
a snapshot of the internal fast-import state as well as the most
814+
recent commands that lead up to the crash.
815+
816+
All recent commands (including stream comments, file changes and
817+
progress commands) are shown in the command history within the crash
818+
report, but raw file data and commit messages are excluded from the
819+
crash report. This exclusion saves space within the report file
820+
and reduces the amount of buffering that fast-import must perform
821+
during execution.
822+
823+
After writing a crash report fast-import will close the current
824+
packfile and export the marks table. This allows the frontend
825+
developer to inspect the repository state and resume the import from
826+
the point where it crashed. The modified branches and tags are not
827+
updated during a crash, as the import did not complete successfully.
828+
Branch and tag information can be found in the crash report and
829+
must be applied manually if the update is needed.
830+
831+
An example crash:
832+
833+
====
834+
$ cat >in <<END_OF_INPUT
835+
# my very first test commit
836+
commit refs/heads/master
837+
committer Shawn O. Pearce <spearce> 19283 -0400
838+
# who is that guy anyway?
839+
data <<EOF
840+
this is my commit
841+
EOF
842+
M 644 inline .gitignore
843+
data <<EOF
844+
.gitignore
845+
EOF
846+
M 777 inline bob
847+
END_OF_INPUT
848+
849+
$ git-fast-import <in
850+
fatal: Corrupt mode: M 777 inline bob
851+
fast-import: dumping crash report to .git/fast_import_crash_8434
852+
853+
$ cat .git/fast_import_crash_8434
854+
fast-import crash report:
855+
fast-import process: 8434
856+
parent process : 1391
857+
at Sat Sep 1 00:58:12 2007
858+
859+
fatal: Corrupt mode: M 777 inline bob
860+
861+
Most Recent Commands Before Crash
862+
---------------------------------
863+
# my very first test commit
864+
commit refs/heads/master
865+
committer Shawn O. Pearce <spearce> 19283 -0400
866+
# who is that guy anyway?
867+
data <<EOF
868+
M 644 inline .gitignore
869+
data <<EOF
870+
* M 777 inline bob
871+
872+
Active Branch LRU
873+
-----------------
874+
active_branches = 1 cur, 5 max
875+
876+
pos clock name
877+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
878+
1) 0 refs/heads/master
879+
880+
Inactive Branches
881+
-----------------
882+
refs/heads/master:
883+
status : active loaded dirty
884+
tip commit : 0000000000000000000000000000000000000000
885+
old tree : 0000000000000000000000000000000000000000
886+
cur tree : 0000000000000000000000000000000000000000
887+
commit clock: 0
888+
last pack :
889+
890+
891+
-------------------
892+
END OF CRASH REPORT
893+
====
894+
808895
Tips and Tricks
809896
---------------
810897
The following tips and tricks have been collected from various

0 commit comments

Comments
 (0)