git/list[1] front-page[2] threads[3] people[4] search[5] about
 

(nearly trivial) patch to compile git on cygwin

From
LLlode leroy <lode_leroy@hotmail.com>
Date
Apr 22, 2005, 08:09 UTC
Message-ID
<BAY22-F35C035C6AE6B9A45CDEF61FF2D0@phx.gbl>

I wonder if anyone is interested in using git on windows / cygwin. It almost compiles out of the box... just this one little thinggy that's glibc-specific (struct dirent . d_type)

~/pkg $ diff -bruw git-0.6 git-0.6-cyg | grep -v ^Only diff -bruw git-0.6/Makefile git-0.6-cyg/Makefile --- git-0.6/Makefile 2005-04-21 19:58:47.000000000 +0200 +++ git-0.6-cyg/Makefile 2005-04-22 09:28:54.259531200 +0200

@@ -30,7 +30,7 @@
$(LIB_FILE): $(LIB_OBJS)
        $(AR) rcs $@ $(LIB_OBJS)

-LIBS= $(LIB_FILE) -lssl -lz
+LIBS= $(LIB_FILE) -lssl -lz -lcrypto

init-db: init-db.o

diff -bruw git-0.6/show-files.c git-0.6-cyg/show-files.c
--- git-0.6/show-files.c        2005-04-21 19:58:47.000000000 +0200
+++ git-0.6-cyg/show-files.c    2005-04-22 10:03:04.227240000 +0200
@@ -61,26 +61,33 @@
                                continue;
                        len = strlen(de->d_name);
                        memcpy(fullname + baselen, de->d_name, len+1);

+#ifdef DT_DIR
                        switch (de->d_type) {
+#endif
                        struct stat st;
+#ifdef DT_DIR
                        default:
                                continue;
                        case DT_UNKNOWN:
+#endif
                                if (lstat(fullname, &st))
                                        continue;
                                if (S_ISREG(st.st_mode))
                                        break;
                                if (!S_ISDIR(st.st_mode))
                                        continue;
+#ifdef DT_DIR
                                /* fallthrough */
                        case DT_DIR:
+#endif
                                memcpy(fullname + baselen + len, "/", 2);
                                read_directory(fullname, fullname, baselen + 
len + 1);
                                continue;
+#ifdef DT_DIR
                        case DT_REG:
                                break;
                        }
+#endif
                        add_name(fullname, baselen + len);
                }
                closedir(dir);
~/pkg $

_________________________________________________________________
Next: Jon Seymour
Message 1 of 2 in “(nearly trivial) patch to compile git on cygwin”
  1. lode leroyApr 22, 2005
  2. [RFC] Is there a need for binary bit in cache/tree entries to properly support Cygwin builds of GIT?Jon Seymour, Apr 22, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.