I am writing an importer-frontend for git-import to create a repository from our "flat-file-version-control".
I managed to get my directories traversed and I am generating the commit-output for all the files I can find in the directories.
But I fail to understand how to handle subdirectories. Something like this:
/dir
|
+-- file
|
+-- /subdir
|
+-- another_file
As far as I understand, I would have to import subdir first, and then another_file. But I do not understand from the documentation how to achive this.
The git documentation about inline data format during commit tells me:
040000: A subdirectory. Subdirectories can only be specified by SHA or through a tree mark set with --import-marks.
How do I retrieve this SHA-hash?
Or am I overcomplicating things here? I remember not having to do git add for directories, as they are added with the files in them. Is it sufficient to only add the files from my source-directory?
Thee is nothing special about it, just put the full path from the root in the commit:
You can simply verify the semantics/syntax of fast-import in creating the needed git structure by hand and do a fast-export into a file. In that case I stumbled over the fact, that fast-import needs '/' and windows uses '\'...