git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/1] git-p4: Add --checkpoint-period option to sync/clone

From
Ori Rawlings <orirawlings@gmail.com>
Date
Sep 15, 2016, 21:17 UTC
Message-ID
<cover.9c54bbdd9f054215b5432c4ba3081110e2e91724.1473973732.git-series.orirawlings@gmail.com>
In-Reply-To
<1473717733-65682-1-git-send-email-orirawlings@gmail.com>

Importing a long history from Perforce into git using the git-p4 tool can be especially challenging. The `git p4 clone` operation is based on an all-or-nothing transactionality guarantee. Under real-world conditions like network unreliability or a busy Perforce server, `git p4 clone` and `git p4 sync` operations can easily fail, forcing a user to restart the import process from the beginning. The longer the history being imported, the more likely a fault occurs during the process. Long enough imports thus become statistically unlikely to ever succeed.

My idea was to leverage the checkpoint feature of git fast-import. I've included a patch which exposes a new option to the sync/clone commands in the git-p4 tool. The option enables explict checkpoints on a periodic basis (approximately every x seconds).

If the sync/clone command fails during processing of Perforce changes, the user can craft a new git p4 sync command that will identify changes that have already been imported and proceed with importing only changes more recent than the last successful checkpoint.

In v2 of this patch series I've added some basic test scenarios, documentation, and did some minor clean up of the implementation based on feedback on v1.

Ori Rawlings (1):
  git-p4: Add --checkpoint-period option to sync/clone
 Documentation/git-p4.txt            | 12 ++++++-
 git-p4.py                           |  7 ++++-
 t/t9830-git-p4-checkpoint-period.sh | 59 ++++++++++++++++++++++++++++++-
 3 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100755 t/t9830-git-p4-checkpoint-period.sh
-- 
git-series 0.8.10
Previous: Luke DiamandNext: Ori Rawlings
Message 4 of 7 in “[git-p4.py] Add --checkpoint-period option to sync/clone”
  1. [git-p4.py] Add --checkpoint-period option to sync/cloneOri Rawlings, Sep 12, 2016
  2. [git-p4.py] Add --checkpoint-period option to sync/cloneOri Rawlings, Sep 12, 2016
  3. Luke DiamandSep 13, 2016
  4. 0/1 git-p4: Add --checkpoint-period option to sync/cloneOri Rawlings, Sep 15, 2016
  5. 1/1 git-p4: Add --checkpoint-period option to sync/cloneOri Rawlings, Sep 15, 2016
  6. Lars SchneiderSep 16, 2016
  7. Ori RawlingsSep 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.