git fast-import --export-marks is able to export a file associating the marks with the commit hashes it created.
So far I've seen the marks are not the ones provided in the input but some "internal ones" not related with the input.
Wouldn't it be much better, for import/export interop, if it keeps the original marks?
The purpose of the marks exported by
fast-import
is to list the commits and the blobs for subsequent verification and synchronisation. The purpose of the marks imported byfast-import
is to skip commits in an incremental export-import scenario.You can see from the tables above how the flags might be combined in a scenario where repos are incrementally synchronised. One might export a repo, import it elsewhere, then either create incremental export files by skipping previously exported commits, or create full exports and incrementally import by skipping commits already known.
Here's a short example to clarify.
Only one mark has been exported, the mark for the single commit added to the repo.
When you proceed to recreate the repository, the exported marks will list not only the commits, but also the new blobs. These new blobs have been re-created, and are present in the marks for you to check, the commits are also listed to compare against all the import referenced commits.
The blob
:1
has been recreated and is newly listed in the marks file (using the first available mark which happens to be:1
), but note that the marked commit:2
retained its mark and its hash from the original exported repo.