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

Re: git-p4 fails when cloning a p4 depo.

From
Simon Hausmann <simon@lst.de>
Date
Jun 17, 2007, 08:11 UTC
Message-ID
<200706171011.52492.simon@lst.de>
In-Reply-To
<466DF32D.802@xs4all.nl>
On Tuesday 12 June 2007 03:13:17 Han-Wen Nienhuys wrote:
Show 20 quoted lines
> Benjamin Sergeant escreveu:
> > A perforce command with all the files in the repo is generated to get
> > all the file content.
> > Here is a patch to break it into multiple successive perforce command
> > who uses 4K of parameter max, and collect the output for later.
> >
> > It works, but not for big depos, because the whole perforce depo
> > content is stored in memory in P4Sync.run(), and it looks like mine is
> > bigger than 2 Gigs, so I had to kill the process.
>
> General idea of the patch is ok.  some nits:
> > +        chunk = ''
> > +        filedata = []
> > +        for i in xrange(len(files)):
>
> why not
>
>   for f in files:
>
> ?

It seems 'i' is used a bit later. Is there a nicer way to express this in python?

Show 9 quoted lines
> > +            f = files[i]
> > +            chunk += '"%s#%s" ' % (f['path'], f['rev'])
> > +            if len(chunk) > 4000 or i == len(files)-1:
>
> 4k seems reasonable enough, but can you take the min() with
> os.sysconf('SC_ARG_MAX') ?
>
> Can you address this and resend so we can apply the patch?
> Thanks.

Since I ran into the very problem of a too long commandline myself yesterday I took the liberty of adding the SC_ARG_MAX bit to Benjamin's patch and comitting it then.

Simon
Previous: Han-Wen NienhuysNext: Benjamin Sergeant
Message 13 of 14 in “git-p4 fails when cloning a p4 depo.”
  1. Benjamin SergeantJun 8, 2007
  2. Benjamin SergeantJun 8, 2007
  3. Scott LambJun 8, 2007
  4. Scott LambJun 8, 2007
  5. Benjamin SergeantJun 8, 2007
  6. Benjamin SergeantJun 8, 2007
  7. Han-Wen NienhuysJun 8, 2007
  8. Benjamin SergeantJun 9, 2007
  9. Simon HausmannJun 8, 2007
  10. Han-Wen NienhuysJun 12, 2007
  11. Han-Wen NienhuysJun 12, 2007
  12. Han-Wen NienhuysJun 12, 2007
  13. Simon HausmannJun 17, 2007
  14. Benjamin SergeantJun 17, 2007

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.