.TP
\-\-export\-marks=<file>
Dumps the internal marks table to <file> when complete. Marks are written one per line as :markid SHA\-1. Frontends can use this file to validate imports after they have been completed.
+.TP
+\-\-quiet
+Disable all non\-fatal output, making gfi silent when it is successful. This option disables the output shown by \-\-stats.
+.TP
+\-\-stats
+Display some basic statistics about the objects gfi has created, the packfiles they were stored into, and the memory used by gfi during this run. Showing this output is currently the default, but can be disabled with \-\-quiet.
.SH "PERFORMANCE"
The design of gfi allows it to import large projects in a minimum amount of memory usage and processing time. Assuming the frontend is able to keep up with gfi and feed it a constant stream of data, import times for projects holding 10+ years of history and containing 100,000+ individual commits are generally completed in just 1\-2 hours on quite modest (~$2,000 USD) hardware.
The following date formats are supported. A frontend should select the format it will use for this import by passing the format name in the \-\-date\-format=<fmt> command line option.
.TP
raw
-This is the Git native format and is <time> SP <tz>. It is also gfi's default format, if \-\-date\-format was not specified.
+This is the Git native format and is <time> SP <offutc>. It is also gfi's default format, if \-\-date\-format was not specified.
The time of the event is specified by <time> as the number of seconds since the UNIX epoch (midnight, Jan 1, 1970, UTC) and is written as an ASCII decimal integer.
-The timezone is specified by <tz> as a positive or negative offset from UTC. For example EST (which is typically 5 hours behind GMT) would be expressed in <tz> by \(lq\-0500\(rq while GMT is \(lq+0000\(rq.
+The local offset is specified by <offutc> as a positive or negative offset from UTC. For example EST (which is 5 hours behind UTC) would be expressed in <tz> by \(lq\-0500\(rq while UTC is \(lq+0000\(rq. The local offset does not affect <time>; it is used only as an advisement to help formatting routines display the timestamp.
-If the timezone is not available in the source material, use \(lq+0000\(rq, or the most common local timezone. For example many organizations have a CVS repository which has only ever been accessed by users who are located in the same location and timezone. In this case the user's timezone can be easily assumed.
+If the local offset is not available in the source material, use \(lq+0000\(rq, or the most common local offset. For example many organizations have a CVS repository which has only ever been accessed by users who are located in the same location and timezone. In this case the offset from UTC can be easily assumed.
Unlike the rfc2822 format, this format is very strict. Any variation in formatting will cause gfi to reject the value.
.TP
Some malformed strings may be accepted as valid dates. In some of these cases Git will still be able to obtain the correct date from the malformed string. There are also some types of malformed strings which Git will parse wrong, and yet consider valid. Seriously malformed strings will be rejected.
+Unlike the raw format above, the timezone/UTC offset information contained in an RFC 2822 date string is used to adjust the date value to UTC prior to storage. Therefore it is important that this information be as accurate as possible.
+
If the source material is formatted in RFC 2822 style dates, the frontend should let gfi handle the parsing and conversion (rather than attempting to do it itself) as the Git parser has been well tested in the wild.
Frontends should prefer the raw format if the source material is already in UNIX\-epoch format, or is easily convertible to that format, as there is no ambiguity in parsing.
data
('from' SP <committish> LF)?
('merge' SP <committish> LF)?
- (filemodify | filedelete)*
+ (filemodify | filedelete | filedeleteall)*
LF
.fi
where <ref> is the name of the branch to make the commit on. Typically branch names are prefixed with refs/heads/ in Git, so importing the CVS branch symbol RELENG\-1_0 would use refs/heads/RELENG\-1_0 for the value of <ref>. The value of <ref> must be a valid refname in Git. As LF is not valid in a Git refname, no quoting or escaping syntax is supported here.
The data command following committer must supply the commit message (see below for data command syntax). To import an empty commit message use a 0 length data. Commit messages are free\-form and are not interpreted by Git. Currently they must be encoded in UTF\-8, as gfi does not permit other encodings to be specified.
-Zero or more filemodify and filedelete commands may be included to update the contents of the branch prior to the commit. These commands can be supplied in any order, gfi is not sensitive to pathname or operation ordering.
+Zero or more filemodify, filedelete and filedeleteall commands may be included to update the contents of the branch prior to creating the commit. These commands may be supplied in any order. However it is recommended that a filedeleteall command preceed all filemodify commands in the same commit, as filedeleteall wipes the branch clean (see below).
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.fi
here <path> is the complete path of the file to be removed. See filemodify above for a detailed description of <path>.
.RE
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+\fBfiledeleteall\fR
+.RS 3
+Included in a commit command to remove all files (and also all directories) from the branch. This command resets the internal branch structure to have no files in it, allowing the frontend to subsequently add all interesting files from scratch.
+.sp
+.nf
+ 'deleteall' LF
+.fi
+This command is extremely useful if the frontend does not know (or does not care to know) what files are currently on the branch, and therefore cannot generate the proper filedelete commands to update the content.
+
+Issuing a filedeleteall followed by the needed filemodify commands to set the correct content will produce the same results as sending only the needed filemodify and filedelete commands. The filedeleteall approach may however require gfi to use slightly more memory per active branch (less than 1 MiB for even most large projects); so frontends that can easily obtain only the affected paths for a commit are encouraged to do so.
+.RE
.SS "mark"
Arranges for gfi to save a reference to the current object, allowing the frontend to recall this object at a future point in time, without knowing its SHA\-1. Here the current object is the object creation command the mark command appears within. This can be commit, tag, and blob, but commit is the most common usage.
.sp
.fi
where <delim> is the chosen delimiter string. The string <delim> must not appear on a line by itself within <raw>, as otherwise gfi will think the data ends earlier than it really does. The LF immediately trailing <raw> is part of <raw>. This is one of the limitations of the delimited format, it is impossible to supply a data chunk which does not have an LF as its last byte.
.SS "checkpoint"
-Forces gfi to close the current packfile and start a new one. As this requires a significant amount of CPU time and disk IO (to compute the overall pack SHA\-1 checksum and generate the corresponding index file) it can easily take several minutes for a single checkpoint command to complete.
+Forces gfi to close the current packfile, start a new one, and to save out all current branch refs, tags and marks.
.sp
.nf
'checkpoint' LF
LF
.fi
+Note that gfi automatically switches packfiles when the current packfile reaches \-\-max\-pack\-size, or 4 GiB, whichever limit is smaller. During an automatic packfile switch gfi does not update the branch refs, tags or marks.
+
+As a checkpoint can require a significant amount of CPU time and disk IO (to compute the overall pack SHA\-1 checksum, generate the corresponding index file, and update the refs) it can easily take several minutes for a single checkpoint command to complete.
+
+Frontends may choose to issue checkpoints during extremely large and long running imports, or when they need to allow another Git process access to a branch. However given that a 30 GiB Subversion repository can be loaded into Git through gfi in about 3 hours, explicit checkpointing may not be necessary.
+.SH "TIPS AND TRICKS"
+The following tips and tricks have been collected from various users of gfi, and are offered here as suggestions.
+.SS "Use One Mark Per Commit"
+When doing a repository conversion, use a unique mark per commit (mark :<n>) and supply the \-\-export\-marks option on the command line. gfi will dump a file which lists every mark and the Git object SHA\-1 that corresponds to it. If the frontend can tie the marks back to the source repository, it is easy to verify the accuracy and completeness of the import by comparing each Git commit to the corresponding source revision.
+
+Coming from a system such as Perforce or Subversion this should be quite simple, as the gfi mark can also be the Perforce changeset number or the Subversion revision number.
+.SS "Freely Skip Around Branches"
+Don't bother trying to optimize the frontend to stick to one branch at a time during an import. Although doing so might be slightly faster for gfi, it tends to increase the complexity of the frontend code considerably.
+
+The branch LRU builtin to gfi tends to behave very well, and the cost of activating an inactive branch is so low that bouncing around between branches has virtually no impact on import performance.
+.SS "Use Tag Fixup Branches"
+Some other SCM systems let the user create a tag from multiple files which are not from the same commit/changeset. Or to create tags which are a subset of the files available in the repository.
+
+Importing these tags as\-is in Git is impossible without making at least one commit which \(lqfixes up\(rq the files to match the content of the tag. Use gfi's reset command to reset a dummy branch outside of your normal branch space to the base commit for the tag, then commit one or more file fixup commits, and finally tag the dummy branch.
+
+For example since all normal branches are stored under refs/heads/ name the tag fixup branch TAG_FIXUP. This way it is impossible for the fixup branch used by the importer to have namespace conflicts with real branches imported from the source (the name TAG_FIXUP is not refs/heads/TAG_FIXUP).
+
+When committing fixups, consider using merge to connect the commit(s) which are supplying file revisions to the fixup branch. Doing so will allow tools such as \fBgit\-blame\fR(1) to track through the real commit history and properly annotate the source files.
+
+After gfi terminates the frontend will need to do rm .git/TAG_FIXUP to remove the dummy branch.
+.SS "Import Now, Repack Later"
+As soon as gfi completes the Git repository is completely valid and ready for use. Typicallly this takes only a very short time, even for considerably large projects (100,000+ commits).
+
+However repacking the repository is necessary to improve data locality and access performance. It can also take hours on extremely large projects (especially if \-f and a large \-\-window parameter is used). Since repacking is safe to run alongside readers and writers, run the repack in the background and let it finish when it finishes. There is no reason to wait to explore your new Git project!
+
+If you choose to wait for the repack, don't try to run benchmarks or performance tests until repacking is completed. gfi outputs suboptimal packfiles that are simply never seen in real use situations.
+.SS "Repacking Historical Data"
+If you are repacking very old imported data (e.g. older than the last year), consider expending some extra CPU time and supplying \-\-window=50 (or higher) when you run \fBgit\-repack\fR(1). This will take longer, but will also produce a smaller packfile. You only need to expend the effort once, and everyone using your project will benefit from the smaller repository.
.SH "PACKFILE OPTIMIZATION"
When packing a blob gfi always attempts to deltify against the last blob written. Unless specifically arranged for by the frontend, this will probably not be a prior version of the same file, so the generated delta will not be the smallest possible. The resulting packfile will be compressed, but will not be optimal.