public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* (nearly trivial) patch to compile git on cygwin
@ 2005-04-22  8:09 lode leroy
  2005-04-22  8:53 ` [RFC] Is there a need for binary bit in cache/tree entries to properly support Cygwin builds of GIT? Jon Seymour
  0 siblings, 1 reply; 2+ messages in thread
From: lode leroy @ 2005-04-22  8:09 UTC (permalink / raw)
  To: git

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 $

_________________________________________________________________



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

* [RFC] Is there a need for binary bit in cache/tree entries to properly support Cygwin builds of GIT?
  2005-04-22  8:09 (nearly trivial) patch to compile git on cygwin lode leroy
@ 2005-04-22  8:53 ` Jon Seymour
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Seymour @ 2005-04-22  8:53 UTC (permalink / raw)
  To: lode leroy; +Cc: git

On 4/22/05, lode leroy <lode_leroy@hotmail•com> wrote:
> 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)
> 
 
I wonder if a cygwin compile of GIT should be forced to strip CR's
from text files prior to checksum calculations and blob storage.
Otherwise, spurious differences may be introduced into text files that
are somehow munged while checked out in a Windows environment.

There is an argument that this should be done external to the GIT
core, but then every external non-unix tool that interacts with GIT
has to have heuristics to distinguish text from binary and they all
have to have the same heuristics.

So, perhaps there is an argument for using one of the unused "mode"
bits to encode a binary flag and add an option to update-cache that
allows the bit to be flipped if a blob is known to be binary. A cygwin
GIT binary could then be forced to strip CR's from blobs marked as
text, but a unix binary need not change its behaviour.

Regards,

jon.

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

end of thread, other threads:[~2005-04-22  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22  8:09 (nearly trivial) patch to compile git on cygwin lode leroy
2005-04-22  8:53 ` [RFC] Is there a need for binary bit in cache/tree entries to properly support Cygwin builds of GIT? Jon Seymour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox