Document some implementation details, for the curious... :)
Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
May 7, 2007 at 20:14 UTC
a844b7406f17ac6e069e617509a2997d7e128500
1 file changed
+17
contrib/fast-import/git-p4.txt
+17
@@ -121,3 +121,20 @@ Example
121
git-p4 rebase
122
123
124
+Implementation Details...
125
+=========================
126
+
127
+* Changesets from Perforce are imported using git fast-import.
128
+* The import does not require anything from the Perforce client view as it just uses
129
+ "p4 print //depot/path/file#revision" to get the actual file contents.
130
+* Every imported changeset has a special [git-p4...] line at the
131
+ end of the log message that gives information about the corresponding
132
+ Perforce change number and is also used by git-p4 itself to find out
133
+ where to continue importing when doing incremental imports.
134
+ Basically when syncing it extracts the perforce change number of the
135
+ latest commit in the "p4" branch and uses "p4 changes //depot/path/...@changenum,#head"
136
+ to find out which changes need to be imported.
137
+* git-p4 submit uses "git rev-list" to pick the commits between the "p4" branch
138
+ and the current branch.
139
+ The commits themselves are applied using git diff-tree ... | patch -p1
140
+