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

[PATCHv1 0/3] git-p4: improvements to p4 "blocking"

From
Luke Diamand <luke@diamand.org>
Date
Jun 5, 2018, 09:13 UTC
Message-ID
<20180605091350.14476-1-luke@diamand.org>
This patchset improves the way that git-p4 sends requests in "blocks".

The problem comes about because the Perforce server limits the maximum number of results it will send back (there are actually two different limits).

This causes git-p4 failures if you ask for too much data.

In commit 96b2d54aee ("git-p4: use -m when running p4 changes", 2015-04-20), git-p4 learned to make requests in blocks, by default 512 in size.

The problem with this, however, is that it can be very slow on large repositories - you might have millions of commits, although only a handful actually relate to the code you are trying to clone. Each 512 block request takes a sizeable fraction of a second to complete.

There's a command-line option to increase the block size, but unless you know about it, it won't be at all obvious that you could use this to speed things up.

This change ~~~~~~~~~~~

The function p4CmdList() has been taught to raise an exception when it gets an error, and in particular, to notice and report the two "too many results" errors.

The code that does the blocking can now start out with a nice large block size, and then reduce it if it sees an error.

Luke Diamand (3):
  git-p4: raise exceptions from p4CmdList based on error from p4 server
  git-p4: narrow the scope of exceptions caught when parsing an int
  git-p4: auto-size the block
 git-p4.py               | 72 +++++++++++++++++++++++++++++++++++------
 t/t9818-git-p4-block.sh | 11 +++++++
 2 files changed, 73 insertions(+), 10 deletions(-)
-- 
2.17.0.392.gdeb1a6e9b7
Next: Luke Diamand
Message 1 of 10 in “[PATCHv1 0/3] git-p4: improvements to p4 "blocking"”
  1. Luke DiamandJun 5, 2018
  2. 1/3 git-p4: raise exceptions from p4CmdList based on error from p4 serverLuke Diamand, Jun 5, 2018
  3. Eric SunshineJun 5, 2018
  4. Luke DiamandJun 5, 2018
  5. Eric SunshineJun 5, 2018
  6. Luke DiamandJun 5, 2018
  7. Luke DiamandJun 8, 2018
  8. 2/3 git-p4: narrow the scope of exceptions caught when parsing an intLuke Diamand, Jun 5, 2018
  9. 3/3 git-p4: auto-size the blockLuke Diamand, Jun 5, 2018
  10. Eric SunshineJun 5, 2018

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.