{"thread":{"id":"9020","subject":"[PATCH] Fix git-p4 on Windows to not use the Posix sysconf","startedAt":"2007-07-13T12:56:00Z","lastAt":"2007-07-16T18:30:50Z","messageCount":8,"participants":["Marius Storm-Olsen","Alex Riesen","Simon Hausmann","Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"47261","messageId":"46977660.7070207@trolltech.com","threadId":"9020","inReplyTo":null,"subject":"[PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2007-07-13T12:56:00Z","receivedAt":"2007-07-13T12:56:00Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":" From 255ec32feb7525db8eef582eeed2b6e60be35ed8 Mon Sep 17 00:00:00 2001\nFrom: Marius Storm-Olsen <marius@trolltech.com>\nDate: Fri, 13 Jul 2007 14:39:05 +0200\nSubject: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf \nfunction.\n\nAdd condition for Windows, since it doesn't support the os.sysconf module.\nWe hardcode the commandline limit to 2K, as that should work on most \nWindows platforms.\n\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n  contrib/fast-import/git-p4 |    6 +++++-\n  1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 54a05eb..746e0ca 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -717,7 +717,11 @@ class P4Sync(Command):\n          # POSIX says it's 4096 bytes, default for Linux seems to be \n130 K.\n          # and all OS from the table below seems to be higher than POSIX.\n          # See http://www.in-ulm.de/~mascheck/various/argmax/\n-        argmax = min(4000, os.sysconf('SC_ARG_MAX'))\n+        if (self.isWindows):\n+            argmax = 2000\n+        else:\n+            argmax = min(4000, os.sysconf('SC_ARG_MAX'))\n+\n          chunk = ''\n          filedata = []\n          for i in xrange(len(files)):\n-- \n1.5.2-GUB\n"},{"id":"47263","messageId":"81b0412b0707130603q69857564i1ba418b74397a33d@mail.gmail.com","threadId":"9020","inReplyTo":"46977660.7070207@trolltech.com","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-13T13:03:51Z","receivedAt":"2007-07-13T13:03:51Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/13/07, Marius Storm-Olsen <marius@trolltech.com> wrote:\n>      argmax = min(4000, os.sysconf('SC_ARG_MAX'))\n\nI wonder why the code in question does not use \"-x\"?\nI use it git-p4-import and haven't seen the limit yet.\nI.e.:\n\n   $ ls |p4 -x - print -q\n   $ p4 help usage\n   ...\n   The -x flag instructs p4 to read arguments, one per line, from the\n   named file.  If the file is named '-', then standard input is read.\n   ...\n"},{"id":"47264","messageId":"200707131533.55544.simon@lst.de","threadId":"9020","inReplyTo":"81b0412b0707130603q69857564i1ba418b74397a33d@mail.gmail.com","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Simon Hausmann","fromEmail":"simon@lst.de","sentAt":"2007-07-13T13:33:54Z","receivedAt":"2007-07-13T13:33:54Z","isPatch":true,"sender":{"key":"hausmann@kde.org","avatar":"https://gravatar.com/avatar/bc9aad4fb31dce17eb66e690e7b51fe980c62da3c225c785da35dd806b8da778?d=mp&s=160"},"body":"On Friday 13 July 2007 15:03:51 Alex Riesen wrote:\n> On 7/13/07, Marius Storm-Olsen <marius@trolltech.com> wrote:\n> >      argmax = min(4000, os.sysconf('SC_ARG_MAX'))\n>\n> I wonder why the code in question does not use \"-x\"?\n> I use it git-p4-import and haven't seen the limit yet.\n> I.e.:\n>\n>    $ ls |p4 -x - print -q\n>    $ p4 help usage\n>    ...\n>    The -x flag instructs p4 to read arguments, one per line, from the\n>    named file.  If the file is named '-', then standard input is read.\n>    ...\n\nGood idea!\n\n\nI still think the patch makes sense as stop-gap for 1.5.3 though, because \nwithout it git-p4 doesn't work at all on Windows.\n\nSimon\n"},{"id":"47396","messageId":"20070715024928.GY4436@spearce.org","threadId":"9020","inReplyTo":"200707131533.55544.simon@lst.de","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-07-15T02:49:28Z","receivedAt":"2007-07-15T02:49:28Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Simon Hausmann <simon@lst.de> wrote:\n> On Friday 13 July 2007 15:03:51 Alex Riesen wrote:\n> > On 7/13/07, Marius Storm-Olsen <marius@trolltech.com> wrote:\n> > >      argmax = min(4000, os.sysconf('SC_ARG_MAX'))\n> >\n> > I wonder why the code in question does not use \"-x\"?\n> > I use it git-p4-import and haven't seen the limit yet.\n> \n> I still think the patch makes sense as stop-gap for 1.5.3 though, because \n> without it git-p4 doesn't work at all on Windows.\n\nThanks.  Marius' patch was whitespace damaged in the context lines,\nbut it was easily repaired.  I've got a couple of other small items\nin my fastimport repository that I'm going to ask Junio to include\nin 1.5.3 shortly.\n\n-- \nShawn.\n"},{"id":"47399","messageId":"7vmyxydwld.fsf@assigned-by-dhcp.cox.net","threadId":"9020","inReplyTo":"20070715024928.GY4436@spearce.org","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-15T06:12:14Z","receivedAt":"2007-07-15T06:12:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> Thanks.  Marius' patch was whitespace damaged in the context lines,\n> but it was easily repaired.  I've got a couple of other small items\n> in my fastimport repository that I'm going to ask Junio to include\n> in 1.5.3 shortly.\n\nThanks for taking care of this.  I have pulled gfi master into\n'master'.  Perhaps we would want to tag -rc2 this weekend, run\nwith it for a week or so and see if we need -rc3 before the\nfinal.\n"},{"id":"47513","messageId":"20070716053511.GC32566@spearce.org","threadId":"9020","inReplyTo":"7vmyxydwld.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-07-16T05:35:11Z","receivedAt":"2007-07-16T05:35:11Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> \n> > Thanks.  Marius' patch was whitespace damaged in the context lines,\n> > but it was easily repaired.  I've got a couple of other small items\n> > in my fastimport repository that I'm going to ask Junio to include\n> > in 1.5.3 shortly.\n> \n> Thanks for taking care of this.  I have pulled gfi master into\n> 'master'.  Perhaps we would want to tag -rc2 this weekend, run\n> with it for a week or so and see if we need -rc3 before the\n> final.\n\nI'm not entirely sure how we're going to handle the git-p4 patches;\nI see there's already another set available to use '-x -' to avoid\ncommand line length problems.\n\nI'm more than happy to play patch monkey and ship them through the\nfastimport repository, but since I'm not a p4 user that offers little\nvalue to the process, other than perhaps to save you a little time.\n\nSimon suggested he might setup a git fork on repo.or.cz himself, at\nwhich point you could pull the patches for git-p4 directly from him.\n\nSimon?\n\n-- \nShawn.\n"},{"id":"47519","messageId":"7vr6n84yux.fsf@assigned-by-dhcp.cox.net","threadId":"9020","inReplyTo":"20070716053511.GC32566@spearce.org","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-16T07:00:22Z","receivedAt":"2007-07-16T07:00:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> I'm more than happy to play patch monkey and ship them through the\n> fastimport repository, but since I'm not a p4 user that offers little\n> value to the process, other than perhaps to save you a little time.\n>\n> Simon suggested he might setup a git fork on repo.or.cz himself, at\n> which point you could pull the patches for git-p4 directly from him.\n>\n> Simon?\n\nPulling from Simon sounds the sanest.\n\nHow big is the population that can help testing and cheering-on\ngit-p4 on this list?  If we can have git-p4 subgroup that would\nbe wonderful, as I do not interoperate with p4 myself.\n"},{"id":"47577","messageId":"200707162030.55268.simon@lst.de","threadId":"9020","inReplyTo":"20070716053511.GC32566@spearce.org","subject":"Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf","fromName":"Simon Hausmann","fromEmail":"simon@lst.de","sentAt":"2007-07-16T18:30:50Z","receivedAt":"2007-07-16T18:30:50Z","isPatch":true,"sender":{"key":"hausmann@kde.org","avatar":"https://gravatar.com/avatar/bc9aad4fb31dce17eb66e690e7b51fe980c62da3c225c785da35dd806b8da778?d=mp&s=160"},"body":"On Monday 16 July 2007 07:35:11 Shawn O. Pearce wrote:\n> Junio C Hamano <gitster@pobox.com> wrote:\n> > \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> > > Thanks.  Marius' patch was whitespace damaged in the context lines,\n> > > but it was easily repaired.  I've got a couple of other small items\n> > > in my fastimport repository that I'm going to ask Junio to include\n> > > in 1.5.3 shortly.\n> >\n> > Thanks for taking care of this.  I have pulled gfi master into\n> > 'master'.  Perhaps we would want to tag -rc2 this weekend, run\n> > with it for a week or so and see if we need -rc3 before the\n> > final.\n>\n> I'm not entirely sure how we're going to handle the git-p4 patches;\n> I see there's already another set available to use '-x -' to avoid\n> command line length problems.\n>\n> I'm more than happy to play patch monkey and ship them through the\n> fastimport repository, but since I'm not a p4 user that offers little\n> value to the process, other than perhaps to save you a little time.\n>\n> Simon suggested he might setup a git fork on repo.or.cz himself, at\n> which point you could pull the patches for git-p4 directly from him.\n>\n> Simon?\n\nYes, sounds good to me. I have tried creating a git clone on repo.or.cz but \nsomehow I can't edit the project. Need to find pasky on IRC to help me :). \nUntil then I have created a repository on freedesktop.org:\n\n\tgit://people.freedesktop.org/~hausmann/git-p4\n\thttp://gitweb.freedesktop.org/?p=users/hausmann/git-p4;a=summary\n\n\nSimon\n"}]}