RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Monday, August 20, 2012 6:54 PM To: Joachim Schmitz Cc: 'Shawn Pearce'; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop Joachim Schmitz j...@schmitz-digital.de writes: I haven't found any other

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 9:30 AM, Joachim Schmitz j...@schmitz-digital.de wrote: OK, so how about this: /usr/local/bin/diff -EBbu ./compat/mkdir.c.orig ./compat/mkdir.c --- ./compat/mkdir.c.orig 2012-08-21 05:02:11 -0500 +++ ./compat/mkdir.c2012-08-21 05:02:11 -0500 @@ -0,0 +1,24 @@

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 10:00 AM, Brandon Casey draf...@gmail.com wrote: Also, we have xstrndup. So I think the body of your function can become something like: if (len dir[len-1] == '/') dir = tmp_dir = xstrndup(dir, len-1); retval = mkdir(dir, mode); free(tmp_dir);

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
From: Brandon Casey [mailto:draf...@gmail.com] Sent: Wednesday, August 22, 2012 7:01 PM To: Joachim Schmitz Cc: Junio C Hamano; Shawn Pearce; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop On Wed, Aug 22, 2012 at 9:30 AM, Joachim Schmitz j...@schmitz

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 10:18 AM, Joachim Schmitz j...@schmitz-digital.de wrote: From: Brandon Casey [mailto:draf...@gmail.com] Sent: Wednesday, August 22, 2012 7:01 PM To: Joachim Schmitz Cc: Junio C Hamano; Shawn Pearce; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Brandon Casey draf...@gmail.com writes: On Wed, Aug 22, 2012 at 9:30 AM, Joachim Schmitz j...@schmitz-digital.de wrote: OK, so how about this: /usr/local/bin/diff -EBbu ./compat/mkdir.c.orig ./compat/mkdir.c --- ./compat/mkdir.c.orig 2012-08-21 05:02:11 -0500 +++ ./compat/mkdir.c

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
From: Brandon Casey [mailto:draf...@gmail.com] Sent: Wednesday, August 22, 2012 7:23 PM To: Joachim Schmitz Cc: Junio C Hamano; Shawn Pearce; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop On Wed, Aug 22, 2012 at 10:18 AM, Joachim Schmitz j...@schmitz

Re: Porting git to HP NonStop

2012-08-22 Thread Johannes Sixt
Am 22.08.2012 19:00, schrieb Brandon Casey: So I think the body of [compat_mkdir] can become something like: if (len dir[len-1] == '/') dir = tmp_dir = xstrndup(dir, len-1); Don't use x* wrappers in the compat layer, at least not those that allocate memory: They behave

Re: Porting git to HP NonStop

2012-08-22 Thread Johannes Sixt
Am 22.08.2012 20:02, schrieb Joachim Schmitz: From: Johannes Sixt [mailto:j...@kdbg.org] Don't use x* wrappers in the compat layer, at least not those that allocate memory: They behave unpredictably due to try_to_free_routine and may lead to recursive invocations. I was just following

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 10:41 AM, Johannes Sixt j...@kdbg.org wrote: Am 22.08.2012 19:00, schrieb Brandon Casey: So I think the body of [compat_mkdir] can become something like: if (len dir[len-1] == '/') dir = tmp_dir = xstrndup(dir, len-1); Don't use x* wrappers in the compat

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
-Original Message- From: Johannes Sixt [mailto:j...@kdbg.org] Sent: Wednesday, August 22, 2012 8:09 PM To: Joachim Schmitz Cc: 'Brandon Casey'; 'Junio C Hamano'; 'Shawn Pearce'; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop Am 22.08.2012 20:02

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 11:09 AM, Brandon Casey draf...@gmail.com wrote: On Wed, Aug 22, 2012 at 10:41 AM, Johannes Sixt j...@kdbg.org wrote: Don't use x* wrappers in the compat layer, at least not those that allocate memory: They behave unpredictably due to try_to_free_routine and may lead

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: Nice. And we have xmemdupz() would be even better as you followed-up. How's that one used? I forgot that we frown upon use of any xallocate() wrapper in the compat/ layer as J6t mentioned. So probably something along these lines...

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Brandon Casey draf...@gmail.com writes: On Wed, Aug 22, 2012 at 10:41 AM, Johannes Sixt j...@kdbg.org wrote: Am 22.08.2012 19:00, schrieb Brandon Casey: So I think the body of [compat_mkdir] can become something like: if (len dir[len-1] == '/') dir = tmp_dir = xstrndup(dir,

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Brandon Casey draf...@gmail.com writes: Perhaps something like: diff --git a/usage.c b/usage.c index a2a6678..2d0ff35 100644 --- a/usage.c +++ b/usage.c @@ -80,8 +80,15 @@ void NORETURN usage(const char *err) void NORETURN die(const char *err, ...) { + static int dying;

Re: Porting git to HP NonStop

2012-08-22 Thread Brandon Casey
On Wed, Aug 22, 2012 at 11:33 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: Perhaps something like: diff --git a/usage.c b/usage.c index a2a6678..2d0ff35 100644 --- a/usage.c +++ b/usage.c @@ -80,8 +80,15 @@ void NORETURN usage(const char *err)

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Wednesday, August 22, 2012 8:25 PM To: Joachim Schmitz Cc: 'Brandon Casey'; 'Shawn Pearce'; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop Joachim Schmitz j...@schmitz-digital.de writes: Nice

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
Hi folks There another API missing on HP NonStop and that is setitimer(), used in progress.c and build/log.c I do have a homebrewed implementation, on top of alarm(), it goes like this: #include ../git-compat-util.h #undef getitimer #undef setitimer int git_getitimer(int which, struct

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: Hi folks There another API missing on HP NonStop and that is setitimer(), used in progress.c and build/log.c I do have a homebrewed implementation, on top of alarm(), it goes like this: #include ../git-compat-util.h #undef getitimer #undef

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Wednesday, August 22, 2012 10:50 PM To: Joachim Schmitz Cc: git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop Joachim Schmitz j...@schmitz-digital.de writes: Hi folks There another API missing

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: If it helps your port, compat/itimer.c sounds like a good place. Doesn't it need a new header file to introduce structures and constants, too? You mean the ITIMER_* and struct itimerval, right? On NonStop these are available in sys/time.h, so

RE: Porting git to HP NonStop

2012-08-22 Thread Joachim Schmitz
-Original Message- From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Wednesday, August 22, 2012 11:12 PM To: Joachim Schmitz Cc: git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop Joachim Schmitz j...@schmitz-digital.de writes: If it helps

Re: Porting git to HP NonStop

2012-08-22 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: I thought of having the function decclaration in git-compat-util.h, just like for eg. setenv, gitmkdtemp, etc. Yeah, that's also fine, especially if you do not have to declare structures and constants. Once you start having to declare other

RE: Porting git to HP NonStop

2012-08-20 Thread Joachim Schmitz
From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Sunday, August 19, 2012 7:23 PM To: Joachim Schmitz Cc: 'Shawn Pearce'; git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop Joachim Schmitz j...@schmitz-digital.de writes: Found the problem: our mkdir

Re: Porting git to HP NonStop

2012-08-20 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: OK, I'll go for a compat/mkdir.c though. No. See below. We shouldn't call it tandem.c as Tandem, the Company, doesn't exist anymore and since more than a decade (bough by Compaq, then HP), only the __TANDEM survived in our compiler and

Re: Porting git to HP NonStop

2012-08-20 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: I haven't found any other to be needed. Well, poll, maybe, but with only minor tweaks for the win32 one works for me (and those tweaks are compatible with win32 A separate file, compat/tandem/mkdir.c, is fine, though. If you wouldn't have

RE: Porting git to HP NonStop

2012-08-19 Thread Joachim Schmitz
From: Shawn Pearce [mailto:spea...@spearce.org] Sent: Friday, August 10, 2012 7:38 PM To: Joachim Schmitz Cc: git@vger.kernel.org; rsbec...@nexbridge.com Subject: Re: Porting git to HP NonStop On Fri, Aug 10, 2012 at 10:32 AM, Joachim Schmitz j...@schmitz-digital.de wrote: then use `git

Re: Porting git to HP NonStop

2012-08-19 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: Found the problem: our mkdir(dir,flags) fails with ENOENT when dir ends with a '/'. Not sure whether this us a bug on out platform or just allowed by POSIX and as such a wrong assumption in git though? [shortly after] A bit of googleing

RE: Porting git to HP NonStop

2012-08-14 Thread Joachim Schmitz
From: Joachim Schmitz [mailto:j...@schmitz-digital.de] Sent: Friday, August 10, 2012 10:09 PM To: 'Shawn Pearce' Cc: 'git@vger.kernel.org'; 'rsbec...@nexbridge.com' Subject: RE: Porting git to HP NonStop From: Joachim Schmitz [mailto:j...@schmitz-digital.de] Sent: Friday, August 10

Re: Porting git to HP NonStop

2012-08-14 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: /usr/local/bin/diff -EBbu ./git-compat-util.h.orig ./git-compat-util.h --- ./git-compat-util.h.orig2012-07-30 15:50:38 -0500 +++ ./git-compat-util.h 2012-08-10 09:59:56 -0500 @@ -74,7 +74,8 @@ # define _XOPEN_SOURCE 500 # endif #elif

Re: Porting git to HP NonStop

2012-08-11 Thread Johannes Sixt
Am 10.08.2012 18:27, schrieb Shawn Pearce: There is no need to define your own mmap(). Define NO_MMAP=1 in the Makefile. Git already has its own fake mmap and knows how to write it back to disk when making changes. Or better to say: the fake mmap has functionality that is sufficient for git.

RE: Porting git to HP NonStop

2012-08-10 Thread Joachim Schmitz
From: git-ow...@vger.kernel.org [mailto:git-ow...@vger.kernel.org] On Behalf Of Joachim Schmitz Sent: Friday, August 10, 2012 5:01 PM To: git@vger.kernel.org Cc: rsbec...@nexbridge.com Subject: RE: [PATCH v2] add tests for 'git rebase --keep-empty' Hi folks I'm a brand new subscriper

Re: Porting git to HP NonStop

2012-08-10 Thread Shawn Pearce
On Fri, Aug 10, 2012 at 8:04 AM, Joachim Schmitz j...@schmitz-digital.de wrote: - HP NonStop is lacking poll(), git is making quite some use of it. My Solution: I 'stole' the implementation from GNUlib, which implements poll() using select(). Git should either provide its own poll(), not use

Re: Porting git to HP NonStop

2012-08-10 Thread Shawn Pearce
On Fri, Aug 10, 2012 at 10:32 AM, Joachim Schmitz j...@schmitz-digital.de wrote: then use `git init --bare` in a new directory to copy in the templates, and see if its the template copying code that is making an incorrect copy. git init --bare gives the same error. It isn't copying any of the

RE: Porting git to HP NonStop

2012-08-10 Thread Joachim Schmitz
From: Joachim Schmitz [mailto:j...@schmitz-digital.de] Sent: Friday, August 10, 2012 7:33 PM To: 'Shawn Pearce' Cc: 'git@vger.kernel.org'; 'rsbec...@nexbridge.com' Subject: RE: Porting git to HP NonStop From: Shawn Pearce [mailto:spea...@spearce.org] Sent: Friday, August 10, 2012 6:28