git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
@ 2007-07-13 12:56 Marius Storm-Olsen
  2007-07-13 13:03 ` Alex Riesen
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Storm-Olsen @ 2007-07-13 12:56 UTC (permalink / raw)
  To: git, Junio C Hamano; +Cc: Simon Hausmann

 From 255ec32feb7525db8eef582eeed2b6e60be35ed8 Mon Sep 17 00:00:00 2001
From: Marius Storm-Olsen <marius@trolltech.com>
Date: Fri, 13 Jul 2007 14:39:05 +0200
Subject: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf 
function.

Add condition for Windows, since it doesn't support the os.sysconf module.
We hardcode the commandline limit to 2K, as that should work on most 
Windows platforms.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
---
  contrib/fast-import/git-p4 |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 54a05eb..746e0ca 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -717,7 +717,11 @@ class P4Sync(Command):
          # POSIX says it's 4096 bytes, default for Linux seems to be 
130 K.
          # and all OS from the table below seems to be higher than POSIX.
          # See http://www.in-ulm.de/~mascheck/various/argmax/
-        argmax = min(4000, os.sysconf('SC_ARG_MAX'))
+        if (self.isWindows):
+            argmax = 2000
+        else:
+            argmax = min(4000, os.sysconf('SC_ARG_MAX'))
+
          chunk = ''
          filedata = []
          for i in xrange(len(files)):
-- 
1.5.2-GUB

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-13 12:56 [PATCH] Fix git-p4 on Windows to not use the Posix sysconf Marius Storm-Olsen
@ 2007-07-13 13:03 ` Alex Riesen
  2007-07-13 13:33   ` Simon Hausmann
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Riesen @ 2007-07-13 13:03 UTC (permalink / raw)
  To: Marius Storm-Olsen; +Cc: git, Junio C Hamano, Simon Hausmann

On 7/13/07, Marius Storm-Olsen <marius@trolltech.com> wrote:
>      argmax = min(4000, os.sysconf('SC_ARG_MAX'))

I wonder why the code in question does not use "-x"?
I use it git-p4-import and haven't seen the limit yet.
I.e.:

   $ ls |p4 -x - print -q
   $ p4 help usage
   ...
   The -x flag instructs p4 to read arguments, one per line, from the
   named file.  If the file is named '-', then standard input is read.
   ...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-13 13:03 ` Alex Riesen
@ 2007-07-13 13:33   ` Simon Hausmann
  2007-07-15  2:49     ` Shawn O. Pearce
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Hausmann @ 2007-07-13 13:33 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Marius Storm-Olsen, git, Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

On Friday 13 July 2007 15:03:51 Alex Riesen wrote:
> On 7/13/07, Marius Storm-Olsen <marius@trolltech.com> wrote:
> >      argmax = min(4000, os.sysconf('SC_ARG_MAX'))
>
> I wonder why the code in question does not use "-x"?
> I use it git-p4-import and haven't seen the limit yet.
> I.e.:
>
>    $ ls |p4 -x - print -q
>    $ p4 help usage
>    ...
>    The -x flag instructs p4 to read arguments, one per line, from the
>    named file.  If the file is named '-', then standard input is read.
>    ...

Good idea!


I still think the patch makes sense as stop-gap for 1.5.3 though, because 
without it git-p4 doesn't work at all on Windows.

Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-13 13:33   ` Simon Hausmann
@ 2007-07-15  2:49     ` Shawn O. Pearce
  2007-07-15  6:12       ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn O. Pearce @ 2007-07-15  2:49 UTC (permalink / raw)
  To: Simon Hausmann; +Cc: Alex Riesen, Marius Storm-Olsen, git, Junio C Hamano

Simon Hausmann <simon@lst.de> wrote:
> On Friday 13 July 2007 15:03:51 Alex Riesen wrote:
> > On 7/13/07, Marius Storm-Olsen <marius@trolltech.com> wrote:
> > >      argmax = min(4000, os.sysconf('SC_ARG_MAX'))
> >
> > I wonder why the code in question does not use "-x"?
> > I use it git-p4-import and haven't seen the limit yet.
> 
> I still think the patch makes sense as stop-gap for 1.5.3 though, because 
> without it git-p4 doesn't work at all on Windows.

Thanks.  Marius' patch was whitespace damaged in the context lines,
but it was easily repaired.  I've got a couple of other small items
in my fastimport repository that I'm going to ask Junio to include
in 1.5.3 shortly.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-15  2:49     ` Shawn O. Pearce
@ 2007-07-15  6:12       ` Junio C Hamano
  2007-07-16  5:35         ` Shawn O. Pearce
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2007-07-15  6:12 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Simon Hausmann, Alex Riesen, Marius Storm-Olsen, git

"Shawn O. Pearce" <spearce@spearce.org> writes:

> Thanks.  Marius' patch was whitespace damaged in the context lines,
> but it was easily repaired.  I've got a couple of other small items
> in my fastimport repository that I'm going to ask Junio to include
> in 1.5.3 shortly.

Thanks for taking care of this.  I have pulled gfi master into
'master'.  Perhaps we would want to tag -rc2 this weekend, run
with it for a week or so and see if we need -rc3 before the
final.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-15  6:12       ` Junio C Hamano
@ 2007-07-16  5:35         ` Shawn O. Pearce
  2007-07-16  7:00           ` Junio C Hamano
  2007-07-16 18:30           ` Simon Hausmann
  0 siblings, 2 replies; 8+ messages in thread
From: Shawn O. Pearce @ 2007-07-16  5:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Simon Hausmann, Alex Riesen, Marius Storm-Olsen, git

Junio C Hamano <gitster@pobox.com> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> > Thanks.  Marius' patch was whitespace damaged in the context lines,
> > but it was easily repaired.  I've got a couple of other small items
> > in my fastimport repository that I'm going to ask Junio to include
> > in 1.5.3 shortly.
> 
> Thanks for taking care of this.  I have pulled gfi master into
> 'master'.  Perhaps we would want to tag -rc2 this weekend, run
> with it for a week or so and see if we need -rc3 before the
> final.

I'm not entirely sure how we're going to handle the git-p4 patches;
I see there's already another set available to use '-x -' to avoid
command line length problems.

I'm more than happy to play patch monkey and ship them through the
fastimport repository, but since I'm not a p4 user that offers little
value to the process, other than perhaps to save you a little time.

Simon suggested he might setup a git fork on repo.or.cz himself, at
which point you could pull the patches for git-p4 directly from him.

Simon?

-- 
Shawn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-16  5:35         ` Shawn O. Pearce
@ 2007-07-16  7:00           ` Junio C Hamano
  2007-07-16 18:30           ` Simon Hausmann
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2007-07-16  7:00 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Simon Hausmann, Alex Riesen, Marius Storm-Olsen, git

"Shawn O. Pearce" <spearce@spearce.org> writes:

> I'm more than happy to play patch monkey and ship them through the
> fastimport repository, but since I'm not a p4 user that offers little
> value to the process, other than perhaps to save you a little time.
>
> Simon suggested he might setup a git fork on repo.or.cz himself, at
> which point you could pull the patches for git-p4 directly from him.
>
> Simon?

Pulling from Simon sounds the sanest.

How big is the population that can help testing and cheering-on
git-p4 on this list?  If we can have git-p4 subgroup that would
be wonderful, as I do not interoperate with p4 myself.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf
  2007-07-16  5:35         ` Shawn O. Pearce
  2007-07-16  7:00           ` Junio C Hamano
@ 2007-07-16 18:30           ` Simon Hausmann
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Hausmann @ 2007-07-16 18:30 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, Alex Riesen, Marius Storm-Olsen, git

[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]

On Monday 16 July 2007 07:35:11 Shawn O. Pearce wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> > "Shawn O. Pearce" <spearce@spearce.org> writes:
> > > Thanks.  Marius' patch was whitespace damaged in the context lines,
> > > but it was easily repaired.  I've got a couple of other small items
> > > in my fastimport repository that I'm going to ask Junio to include
> > > in 1.5.3 shortly.
> >
> > Thanks for taking care of this.  I have pulled gfi master into
> > 'master'.  Perhaps we would want to tag -rc2 this weekend, run
> > with it for a week or so and see if we need -rc3 before the
> > final.
>
> I'm not entirely sure how we're going to handle the git-p4 patches;
> I see there's already another set available to use '-x -' to avoid
> command line length problems.
>
> I'm more than happy to play patch monkey and ship them through the
> fastimport repository, but since I'm not a p4 user that offers little
> value to the process, other than perhaps to save you a little time.
>
> Simon suggested he might setup a git fork on repo.or.cz himself, at
> which point you could pull the patches for git-p4 directly from him.
>
> Simon?

Yes, sounds good to me. I have tried creating a git clone on repo.or.cz but 
somehow I can't edit the project. Need to find pasky on IRC to help me :). 
Until then I have created a repository on freedesktop.org:

	git://people.freedesktop.org/~hausmann/git-p4
	http://gitweb.freedesktop.org/?p=users/hausmann/git-p4;a=summary


Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-07-16 18:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 12:56 [PATCH] Fix git-p4 on Windows to not use the Posix sysconf Marius Storm-Olsen
2007-07-13 13:03 ` Alex Riesen
2007-07-13 13:33   ` Simon Hausmann
2007-07-15  2:49     ` Shawn O. Pearce
2007-07-15  6:12       ` Junio C Hamano
2007-07-16  5:35         ` Shawn O. Pearce
2007-07-16  7:00           ` Junio C Hamano
2007-07-16 18:30           ` Simon Hausmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).