{"thread":{"id":"239","subject":"(nearly trivial) patch to compile git on cygwin","startedAt":"2005-04-22T08:09:08Z","lastAt":"2005-04-22T08:53:17Z","messageCount":2,"participants":["lode leroy","Jon Seymour"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"1247","messageId":"BAY22-F35C035C6AE6B9A45CDEF61FF2D0@phx.gbl","threadId":"239","inReplyTo":null,"subject":"(nearly trivial) patch to compile git on cygwin","fromName":"lode leroy","fromEmail":"lode_leroy@hotmail.com","sentAt":"2005-04-22T08:09:08Z","receivedAt":"2005-04-22T08:09:08Z","isPatch":false,"sender":{"key":"lode_leroy@hotmail.com","avatar":null},"body":"I wonder if anyone is interested in using git on windows / cygwin.\nIt almost compiles out of the box... just this one little thinggy\nthat's glibc-specific (struct dirent . d_type)\n\n~/pkg $ diff -bruw git-0.6 git-0.6-cyg | grep -v ^Only\ndiff -bruw git-0.6/Makefile git-0.6-cyg/Makefile\n--- git-0.6/Makefile    2005-04-21 19:58:47.000000000 +0200\n+++ git-0.6-cyg/Makefile        2005-04-22 09:28:54.259531200 +0200\n@@ -30,7 +30,7 @@\n$(LIB_FILE): $(LIB_OBJS)\n        $(AR) rcs $@ $(LIB_OBJS)\n\n-LIBS= $(LIB_FILE) -lssl -lz\n+LIBS= $(LIB_FILE) -lssl -lz -lcrypto\n\ninit-db: init-db.o\n\ndiff -bruw git-0.6/show-files.c git-0.6-cyg/show-files.c\n--- git-0.6/show-files.c        2005-04-21 19:58:47.000000000 +0200\n+++ git-0.6-cyg/show-files.c    2005-04-22 10:03:04.227240000 +0200\n@@ -61,26 +61,33 @@\n                                continue;\n                        len = strlen(de->d_name);\n                        memcpy(fullname + baselen, de->d_name, len+1);\n\n+#ifdef DT_DIR\n                        switch (de->d_type) {\n+#endif\n                        struct stat st;\n+#ifdef DT_DIR\n                        default:\n                                continue;\n                        case DT_UNKNOWN:\n+#endif\n                                if (lstat(fullname, &st))\n                                        continue;\n                                if (S_ISREG(st.st_mode))\n                                        break;\n                                if (!S_ISDIR(st.st_mode))\n                                        continue;\n+#ifdef DT_DIR\n                                /* fallthrough */\n                        case DT_DIR:\n+#endif\n                                memcpy(fullname + baselen + len, \"/\", 2);\n                                read_directory(fullname, fullname, baselen + \nlen + 1);\n                                continue;\n+#ifdef DT_DIR\n                        case DT_REG:\n                                break;\n                        }\n+#endif\n                        add_name(fullname, baselen + len);\n                }\n                closedir(dir);\n~/pkg $\n\n_________________________________________________________________\n\n\n"},{"id":"1248","messageId":"2cfc403205042201534bef0276@mail.gmail.com","threadId":"239","inReplyTo":"BAY22-F35C035C6AE6B9A45CDEF61FF2D0@phx.gbl","subject":"[RFC] Is there a need for binary bit in cache/tree entries to properly support Cygwin builds of GIT?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-04-22T08:53:17Z","receivedAt":"2005-04-22T08:53:17Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On 4/22/05, lode leroy <lode_leroy@hotmail.com> wrote:\n> I wonder if anyone is interested in using git on windows / cygwin.\n> It almost compiles out of the box... just this one little thinggy\n> that's glibc-specific (struct dirent . d_type)\n> \n \nI wonder if a cygwin compile of GIT should be forced to strip CR's\nfrom text files prior to checksum calculations and blob storage.\nOtherwise, spurious differences may be introduced into text files that\nare somehow munged while checked out in a Windows environment.\n\nThere is an argument that this should be done external to the GIT\ncore, but then every external non-unix tool that interacts with GIT\nhas to have heuristics to distinguish text from binary and they all\nhave to have the same heuristics.\n\nSo, perhaps there is an argument for using one of the unused \"mode\"\nbits to encode a binary flag and add an option to update-cache that\nallows the bit to be flipped if a blob is known to be binary. A cygwin\nGIT binary could then be forced to strip CR's from blobs marked as\ntext, but a unix binary need not change its behaviour.\n\nRegards,\n\njon.\n"}]}