From: Simon Hausmann Date: Sun, 24 Aug 2008 14:12:23 +0000 (+0200) Subject: Clean up the git-p4 documentation X-Git-Tag: v1.6.0.1~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5f7e4a18cf656747be8f8447ca304ddf716c742;p=git.git Clean up the git-p4 documentation This patch massages the documentation a bit for improved readability and cleans it up from outdated options/commands. Signed-off-by: Simon Hausmann Signed-off-by: Junio C Hamano --- diff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt index ac551d45f..49b335921 100644 --- a/contrib/fast-import/git-p4.txt +++ b/contrib/fast-import/git-p4.txt @@ -3,14 +3,16 @@ git-p4 - Perforce <-> Git converter using git-fast-import Usage ===== -git-p4 supports two main modes: Importing from Perforce to a Git repository is -done using "git-p4 sync" or "git-p4 rebase". Submitting changes from Git back -to Perforce is done using "git-p4 submit". +git-p4 can be used in two different ways: + +1) To import changes from Perforce to a Git repository, using "git-p4 sync". + +2) To submit changes from Git back to Perforce, using "git-p4 submit". Importing ========= -You can simply start with +Simply start with git-p4 clone //depot/path/project @@ -18,11 +20,18 @@ or git-p4 clone //depot/path/project myproject -This will create an empty git repository in a subdirectory called "project" (or -"myproject" with the second command), import the head revision from the -specified perforce path into a git "p4" branch (remotes/p4 actually), create a -master branch off it and check it out. If you want the entire history (not just -the head revision) then you can simply append a "@all" to the depot path: +This will: + +1) Create an empty git repository in a subdirectory called "project" (or +"myproject" with the second command) + +2) Import the head revision from the given Perforce path into a git branch +called "p4" (remotes/p4 actually) + +3) Create a master branch based on it and check it out. + +If you want the entire history (not just the head revision) then you can simply +append a "@all" to the depot path: git-p4 clone //depot/project/main@all myproject @@ -37,31 +46,40 @@ If you want more control you can also use the git-p4 sync command directly: This will import the current head revision of the specified depot path into a "remotes/p4/master" branch of your git repository. You can use the ---branch=mybranch option to use a different branch. +--branch=mybranch option to import into a different branch. -If you want to import the entire history of a given depot path just use +If you want to import the entire history of a given depot path simply use: git-p4 sync //path/in/depot@all + +Note: + To achieve optimal compression you may want to run 'git repack -a -d -f' after a big import. This may take a while. -Support for Perforce integrations is still work in progress. Don't bother -trying it unless you want to hack on it :) - Incremental Imports =================== -After an initial import you can easily synchronize your git repository with -newer changes from the Perforce depot by just calling +After an initial import you can continue to synchronize your git repository +with newer changes from the Perforce depot by just calling git-p4 sync in your git repository. By default the "remotes/p4/master" branch is updated. -It is recommended to run 'git repack -a -d -f' from time to time when using -incremental imports to optimally combine the individual git packs that each -incremental import creates through the use of git-fast-import. +Advanced Setup +============== + +Suppose you have a periodically updated git repository somewhere, containing a +complete import of a Perforce project. This repository can be cloned and used +with git-p4. When updating the cloned repository with the "sync" command, +git-p4 will try to fetch changes from the original repository first. The git +protocol used with this is usually faster than importing from Perforce +directly. + +This behaviour can be disabled by setting the "git-p4.syncFromOrigin" git +configuration variable to "false". Updating ======== @@ -79,7 +97,7 @@ Submitting ========== git-p4 has support for submitting changes from a git repository back to the -Perforce depot. This requires a Perforce checkout separate to your git +Perforce depot. This requires a Perforce checkout separate from your git repository. To submit all changes that are in the current git branch but not in the "p4" branch (or "origin" if "p4" doesn't exist) simply call @@ -97,17 +115,6 @@ continue importing the remaining changes with git-p4 submit --continue -After submitting you should sync your perforce import branch ("p4" or "origin") -from Perforce using git-p4's sync command. - -If you have changes in your working directory that you haven't committed into -git yet but that you want to commit to Perforce directly ("quick fixes") then -you do not have to go through the intermediate step of creating a git commit -first but you can just call - - git-p4 submit --direct - - Example =======