{"thread":{"id":"22962","subject":"Re: git interix support","startedAt":"2010-03-09T10:35:02Z","lastAt":"2010-03-11T07:13:57Z","messageCount":5,"participants":["Johannes Schindelin","Markus Duft","Erik Faye-Lund","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136447","messageId":"4B962456.20600@salomon.at","threadId":"22962","inReplyTo":null,"subject":"git interix support","fromName":"Markus Duft","fromEmail":"markus.duft@salomon.at","sentAt":"2010-03-09T10:35:02Z","receivedAt":"2010-03-09T10:35:02Z","isPatch":false,"sender":{"key":"markus.duft@salomon.at","avatar":null},"body":"Hey.\n\ni have \"ported\" git to interix (haha, wasn't so much of a problem after\nall ;)). i have a small patch (attached). i know that it sure doesn't\nhave production quality yet, but i try gathering ideas/input here.\n\nadditionally to the patch i'm setting:\n\n147     if [[ ${CHOST} == *-interix* ]] ; then\n148         myopts=\"${myopts} NO_IPV6=YesPlease\"\n149         myopts=\"${myopts} NO_MEMMEM=YesPlease\"\n150         myopts=\"${myopts} NO_MKDTEMP=YesPlease\"\n151         myopts=\"${myopts} NO_STRTOUMAX=YesPlease\"\n152         myopts=\"${myopts} NO_STRTOULL=YesPlease\"\n153         myopts=\"${myopts} NO_INET_NTOP=YesPlease\"\n154         myopts=\"${myopts} NO_INET_PTON=YesPlease\"\n155         myopts=\"${myopts} NO_NSEC=YesPlease\"\n156         myopts=\"${myopts} NO_MKSTEMPS=YesPlease\"\n157     fi\n\ninterix lacks propper poll() support (poll is there but broken), so some\nof the things in git have to be disabled for now, or replaced by a\nselect() code (but that'd take precious time of mine to implement (argh)).\n\nany comments on the patch? any chance to get stuff upstream?\n\n(BTW. i know that this is not the most current git release i'm patching\n(1.6.6.1), and i'll have to forward port the patch at some point anyway\n- i hope i'll get to this soon...)\n\nThanks in advance!\n\nCheers, Markus\n\n\ndiff -ru git-1.6.6.1.orig/builtin-upload-archive.c git-1.6.6.1/builtin-upload-archive.c\n--- git-1.6.6.1.orig/builtin-upload-archive.c\t2010-03-09 10:51:28 +0100\n+++ git-1.6.6.1/builtin-upload-archive.c\t2010-03-09 11:06:45 +0100\n@@ -132,8 +132,9 @@\n \tpacket_flush(1);\n \n \twhile (1) {\n-\t\tstruct pollfd pfd[2];\n \t\tint status;\n+#ifndef __INTERIX\n+\t\tstruct pollfd pfd[2];\n \n \t\tpfd[0].fd = fd1[0];\n \t\tpfd[0].events = POLLIN;\n@@ -156,6 +157,8 @@\n \t\t\tif (process_input(pfd[0].fd, 1))\n \t\t\t\tcontinue;\n \n+#endif\n+\n \t\tif (waitpid(writer, &status, 0) < 0)\n \t\t\terror_clnt(\"%s\", lostchild);\n \t\telse if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)\ndiff -ru git-1.6.6.1.orig/daemon.c git-1.6.6.1/daemon.c\n--- git-1.6.6.1.orig/daemon.c\t2010-03-09 10:51:28 +0100\n+++ git-1.6.6.1/daemon.c\t2010-03-09 11:00:50 +0100\n@@ -14,6 +14,8 @@\n #define NI_MAXSERV 32\n #endif\n \n+#ifndef __INTERIX /* not available on interix! */\n+\n static int log_syslog;\n static int verbose;\n static int reuseaddr;\n@@ -922,8 +924,13 @@\n \treturn service_loop(socknum, socklist);\n }\n \n+#endif /* __INTERIX */\n+\n int main(int argc, char **argv)\n {\n+#ifdef __INTERIX\n+\tdie(\"not implemented on interix!\");\n+#else /* !__INTERIX */\n \tint listen_port = 0;\n \tchar *listen_addr = NULL;\n \tint inetd_mode = 0;\n@@ -1121,4 +1128,5 @@\n \t\tstore_pid(pid_file);\n \n \treturn serve(listen_addr, listen_port, pass, gid);\n+#endif /* __INTERIX */\n }\ndiff -ru git-1.6.6.1.orig/git-compat-util.h git-1.6.6.1/git-compat-util.h\n--- git-1.6.6.1.orig/git-compat-util.h\t2010-03-09 10:51:29 +0100\n+++ git-1.6.6.1/git-compat-util.h\t2010-03-09 10:53:59 +0100\n@@ -93,7 +93,9 @@\n #include <utime.h>\n #ifndef __MINGW32__\n #include <sys/wait.h>\n+#ifndef __INTERIX\n #include <sys/poll.h>\n+#endif\n #include <sys/socket.h>\n #include <sys/ioctl.h>\n #ifndef NO_SYS_SELECT_H\n@@ -104,7 +106,11 @@\n #include <arpa/inet.h>\n #include <netdb.h>\n #include <pwd.h>\n+#ifndef __INTERIX\n #include <inttypes.h>\n+#else\n+#include <stdint.h>\n+#endif\n #if defined(__CYGWIN__)\n #undef _XOPEN_SOURCE\n #include <grp.h>\ndiff -ru git-1.6.6.1.orig/upload-pack.c git-1.6.6.1/upload-pack.c\n--- git-1.6.6.1.orig/upload-pack.c\t2010-03-09 10:51:33 +0100\n+++ git-1.6.6.1/upload-pack.c\t2010-03-09 10:58:02 +0100\n@@ -150,6 +150,7 @@\n \n static void create_pack_file(void)\n {\n+#ifndef __INTERIX\n \tstruct async rev_list;\n \tstruct child_process pack_objects;\n \tint create_full_pack = (nr_our_refs == want_obj.nr && !have_obj.nr);\n@@ -328,6 +329,9 @@\n  fail:\n \tsend_client_data(3, abort_msg, sizeof(abort_msg));\n \tdie(\"git upload-pack: %s\", abort_msg);\n+#else /* __INTERIX */\n+\tdie(\"git upload-pack: not implemented on interix!\");\n+#endif /* __INTERIX */\n }\n \n static int got_sha1(char *hex, unsigned char *sha1)\n"},{"id":"136445","messageId":"alpine.DEB.1.00.1003091220510.3065@intel-tinevez-2-302","threadId":"22962","inReplyTo":"4B962456.20600@salomon.at","subject":"Re: git interix support","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-03-09T11:24:20Z","receivedAt":"2010-03-09T11:24:20Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 9 Mar 2010, Markus Duft wrote:\n\n> i have \"ported\" git to interix (haha, wasn't so much of a problem after\n> all ;)). i have a small patch (attached).\n\nPlease inline the patch for easier review. Unless you want no review, that \nis :-)\n\n>From a cursory view, it looks as if all your #ifdef INTERIX actually want \nto be #ifdef HAVE_POLL or some such (we try to define the appropriate \nflags regarding the available features in the Makefile, see for example \nHAVE_ALLOCA_H).\n\nAnd of course, at some stage it would be good to at least skim\nhttp://repo.or.cz/w/git.git?a=blob_plain;f=Documentation/SubmittingPatches\n\nCiao,\nDscho\n"},{"id":"136448","messageId":"40aa078e1003090328o161675f1tbc33b8740801b6a@mail.gmail.com","threadId":"22962","inReplyTo":"4B962456.20600@salomon.at","subject":"Re: git interix support","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2010-03-09T11:28:52Z","receivedAt":"2010-03-09T11:28:52Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Mar 9, 2010 at 11:35 AM, Markus Duft <markus.duft@salomon.at> wrote:\n> any comments on the patch?\n\nI find it a bit odd to submit a patch against the Git source code that\nhasn't been produced by Git, but manual diff'ing of different source\ntrees...\n\n-- \nErik \"kusma\" Faye-Lund\n"},{"id":"136532","messageId":"alpine.LNX.2.00.1003101319350.14365@iabervon.org","threadId":"22962","inReplyTo":"4B962456.20600@salomon.at","subject":"Re: git interix support","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2010-03-10T18:32:29Z","receivedAt":"2010-03-10T18:32:29Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 9 Mar 2010, Markus Duft wrote:\n\n> Hey.\n> \n> i have \"ported\" git to interix (haha, wasn't so much of a problem after\n> all ;)). i have a small patch (attached). i know that it sure doesn't\n> have production quality yet, but i try gathering ideas/input here.\n> \n> additionally to the patch i'm setting:\n> \n> 147     if [[ ${CHOST} == *-interix* ]] ; then\n> 148         myopts=\"${myopts} NO_IPV6=YesPlease\"\n> 149         myopts=\"${myopts} NO_MEMMEM=YesPlease\"\n> 150         myopts=\"${myopts} NO_MKDTEMP=YesPlease\"\n> 151         myopts=\"${myopts} NO_STRTOUMAX=YesPlease\"\n> 152         myopts=\"${myopts} NO_STRTOULL=YesPlease\"\n> 153         myopts=\"${myopts} NO_INET_NTOP=YesPlease\"\n> 154         myopts=\"${myopts} NO_INET_PTON=YesPlease\"\n> 155         myopts=\"${myopts} NO_NSEC=YesPlease\"\n> 156         myopts=\"${myopts} NO_MKSTEMPS=YesPlease\"\n> 157     fi\n> \n> interix lacks propper poll() support (poll is there but broken), so some\n> of the things in git have to be disabled for now, or replaced by a\n> select() code (but that'd take precious time of mine to implement (argh)).\n> \n> any comments on the patch? any chance to get stuff upstream?\n\nIf you've got programs that don't work at all without some library \nfunction that you don't have, it's better to not build them at all (by not \nhaving them in the make targets) than build binaries that refuse to run. \nDoing it that way means you don't need to get the rest of the file to \ncompile, and makes it more clear before runtime what functionality will be \nmissing.\n\nAlso, if you make a NO_POLL and use that, someone else might make a \ncompat_poll(). Or maybe not, but a workaround certainly won't get done if \nyou just use __INTERIX.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"136559","messageId":"4B989835.2010805@salomon.at","threadId":"22962","inReplyTo":"alpine.LNX.2.00.1003101319350.14365@iabervon.org","subject":"Re: git interix support","fromName":"Markus Duft","fromEmail":"markus.duft@salomon.at","sentAt":"2010-03-11T07:13:57Z","receivedAt":"2010-03-11T07:13:57Z","isPatch":false,"sender":{"key":"markus.duft@salomon.at","avatar":null},"body":"On 03/10/10 19:32, Daniel Barkalow wrote:\n> On Tue, 9 Mar 2010, Markus Duft wrote:\n> \n[snip]\n> \n> If you've got programs that don't work at all without some library \n> function that you don't have, it's better to not build them at all (by not \n> having them in the make targets) than build binaries that refuse to run. \n> Doing it that way means you don't need to get the rest of the file to \n> compile, and makes it more clear before runtime what functionality will be \n> missing.\n> \n> Also, if you make a NO_POLL and use that, someone else might make a \n> compat_poll(). Or maybe not, but a workaround certainly won't get done if \n> you just use __INTERIX.\n\nthanks for the input (all of you). i will spend some more time, doing a\nbetter patch... :)\n\nmarkus\n\n> \n> \t-Daniel\n> *This .sig left intentionally blank*\n"}]}