{"thread":{"id":"2748","subject":"make gitfakemmap standalone to fix linking error in git.c","startedAt":"2005-12-05T13:19:22Z","lastAt":"2005-12-06T09:53:14Z","messageCount":23,"participants":["Alex Riesen","Petr Baudis","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"13201","messageId":"81b0412b0512050519k5ed80035x9eb4907f569e0a4b@mail.gmail.com","threadId":"2748","inReplyTo":null,"subject":"make gitfakemmap standalone to fix linking error in git.c","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-05T13:19:22Z","receivedAt":"2005-12-05T13:19:22Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"The patch is to fix linking error because of gitfakemmap referencing\ndie living in usage.c, and git.c not linking in the file. Instead of\nhardcoding usage.o in git.c prerequisites, I separated mmap from the\nmain sources.\n\n\nSubject: [PATCH] make fakemmap standalone to fix linking error because of gitfakemmap\nreferencing die living in usage.c, and git.c not linking in the file.\nInstead of hardcoding usage.o in git.c prerequisites, I separated mmap.\n\nSigned-off-by: Alex Riesen <fork0@gmail.com>\n\n\n---\n\n cache.h       |   18 +++---------------\n compat/mmap.c |   11 +++++++----\n compat/mmap.h |   15 +++++++++++++++\n 3 files changed, 25 insertions(+), 19 deletions(-)\n create mode 100644 compat/mmap.h\n\ne1e24d29b684d468a7be5d097ba3e1679170e7db\ndiff --git a/cache.h b/cache.h\nindex f9b367f..c70a467 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -11,7 +11,9 @@\n #include <string.h>\n #include <errno.h>\n #include <limits.h>\n-#ifndef NO_MMAP\n+#ifdef NO_MMAP\n+#include \"compat/mmap.h\"\n+#else\n #include <sys/mman.h>\n #endif\n #include <sys/param.h>\n@@ -373,20 +375,6 @@ extern void packed_object_info_detail(st\n /* Dumb servers support */\n extern int update_server_info(int);\n \n-#ifdef NO_MMAP\n-\n-#ifndef PROT_READ\n-#define PROT_READ 1\n-#define PROT_WRITE 2\n-#define MAP_PRIVATE 1\n-#define MAP_FAILED ((void*)-1)\n-#endif\n-\n-extern void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);\n-extern int gitfakemunmap(void *start, size_t length);\n-\n-#endif\n-\n typedef int (*config_fn_t)(const char *, const char *);\n extern int git_default_config(const char *, const char *);\n extern int git_config_from_file(config_fn_t fn, const char *);\ndiff --git a/compat/mmap.c b/compat/mmap.c\nindex a051c47..98cf3cb 100644\n--- a/compat/mmap.c\n+++ b/compat/mmap.c\n@@ -2,21 +2,24 @@\n #include <stdlib.h>\n #include <unistd.h>\n #include <errno.h>\n-#include \"../cache.h\"\n+#include <string.h>\n+#include \"mmap.h\"\n \n void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset)\n {\n \tint n = 0;\n \n-\tif (start != NULL || !(flags & MAP_PRIVATE))\n-\t\tdie(\"Invalid usage of gitfakemmap.\");\n+\tif (!start || !(flags & MAP_PRIVATE)) {\n+\t\tfprintf(stderr, \"Invalid usage of gitfakemmap.\\n\");\n+\t\texit(128); /* see die() in ../usage.c */\n+\t}\n \n \tif (lseek(fd, offset, SEEK_SET) < 0) {\n \t\terrno = EINVAL;\n \t\treturn MAP_FAILED;\n \t}\n \n-\tstart = xmalloc(length);\n+\tstart = malloc(length);\n \tif (start == NULL) {\n \t\terrno = ENOMEM;\n \t\treturn MAP_FAILED;\ndiff --git a/compat/mmap.h b/compat/mmap.h\nnew file mode 100644\nindex 0000000..08d7f99\n--- /dev/null\n+++ b/compat/mmap.h\n@@ -0,0 +1,15 @@\n+#ifndef MMAP_H\n+#define MMAP_H\n+\n+#ifndef PROT_READ\n+#define PROT_READ 1\n+#define PROT_WRITE 2\n+#define MAP_PRIVATE 1\n+#define MAP_FAILED ((void*)-1)\n+#endif\n+\n+extern void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);\n+extern int gitfakemunmap(void *start, size_t length);\n+\n+#endif\n+\n-- \n0.99.9.GIT\n"},{"id":"13202","messageId":"81b0412b0512050524w7b632651n93c836fda41a39d@mail.gmail.com","threadId":"2748","inReplyTo":"81b0412b0512050519k5ed80035x9eb4907f569e0a4b@mail.gmail.com","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-05T13:24:47Z","receivedAt":"2005-12-05T13:24:47Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"The patch is to fix the error introduced by previous patch, which\ninverted condition of checking for the supported case (start must be\nNULL).\n\nOn 12/5/05, Alex Riesen <raa.lkml@gmail.com> wrote:\n> The patch is to fix linking error because of gitfakemmap referencing\n> die living in usage.c, and git.c not linking in the file. Instead of\n> hardcoding usage.o in git.c prerequisites, I separated mmap from the\n> main sources.\n\nWhy does it always happen...\n\n\nSubject: [PATCH] fix bug introduced by previous change\n\nSigned-off-by: Alex Riesen <ariesen@harmanbecker.com>\n\n\n---\n\n compat/mmap.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\n58d38f03086fe30f3f758f2f27fde0ad05107b4a\ndiff --git a/compat/mmap.c b/compat/mmap.c\nindex 98cf3cb..cfa1f25 100644\n--- a/compat/mmap.c\n+++ b/compat/mmap.c\n@@ -9,7 +9,7 @@ void *gitfakemmap(void *start, size_t le\n {\n \tint n = 0;\n \n-\tif (!start || !(flags & MAP_PRIVATE)) {\n+\tif (start || !(flags & MAP_PRIVATE)) {\n \t\tfprintf(stderr, \"Invalid usage of gitfakemmap.\\n\");\n \t\texit(128); /* see die() in ../usage.c */\n \t}\n-- \n0.99.9.GIT\n"},{"id":"13203","messageId":"20051205141141.GF22159@pasky.or.cz","threadId":"2748","inReplyTo":"81b0412b0512050524w7b632651n93c836fda41a39d@mail.gmail.com","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-12-05T14:11:41Z","receivedAt":"2005-12-05T14:11:41Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Dec 05, 2005 at 02:24:47PM CET, I got a letter\nwhere Alex Riesen <raa.lkml@gmail.com> said that...\n> The patch is to fix the error introduced by previous patch, which\n> inverted condition of checking for the supported case (start must be\n> NULL).\n> \n> On 12/5/05, Alex Riesen <raa.lkml@gmail.com> wrote:\n> > The patch is to fix linking error because of gitfakemmap referencing\n> > die living in usage.c, and git.c not linking in the file. Instead of\n> > hardcoding usage.o in git.c prerequisites, I separated mmap from the\n> > main sources.\n> \n> Why does it always happen...\n\nPossibly not worth yet another patch submission now, but in general I\nbelieve it's better to send new revision of the original patch rather\nthan another patch on top of the previous one.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"13205","messageId":"81b0412b0512050743i3084eadag7df00793a26ec3a9@mail.gmail.com","threadId":"2748","inReplyTo":"20051205141141.GF22159@pasky.or.cz","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-05T15:43:57Z","receivedAt":"2005-12-05T15:43:57Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 12/5/05, Petr Baudis <pasky@suse.cz> wrote:\n> > The patch is to fix the error introduced by previous patch, which\n> > inverted condition of checking for the supported case (start must be\n> > NULL).\n>\n> Possibly not worth yet another patch submission now, but in general I\n> believe it's better to send new revision of the original patch rather\n> than another patch on top of the previous one.\n\nYes, of course. Sorry... I will not resend, it's trivial, but I\npromise to get better.\n"},{"id":"13207","messageId":"7vfyp7cuii.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"81b0412b0512050524w7b632651n93c836fda41a39d@mail.gmail.com","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T17:40:21Z","receivedAt":"2005-12-05T17:40:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Why does it always happen...\n\nBecause you touched you did not absolutely have to ;-).\n\nWhen I took setenv patch for git.c, I was thinking about\nsomething similar.  It may be cleaner to split out the pieces so\nthat the functions like usage(), die(), xmalloc() and friends\ncould be linkable in git.c and others that want to link in only\nthe minimum set without including \"cache.h\" which has more\nintimate knowledge of other git internals.\n"},{"id":"13213","messageId":"7voe3vb8fh.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"7vfyp7cuii.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T20:22:42Z","receivedAt":"2005-12-05T20:22:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This attempts to clean up the way various compatibility\nfunctions are defined and used.\n\n - A new header file, git-compat-util.h, is introduced.  This\n   looks at various NO_XXX and does necessary function name\n   replacements, equivalent of -Dstrcasestr=gitstrcasestr in the\n   Makefile.\n\n - Those function name replacements are removed from the Makefile.\n\n - Common features such as usage(), die(), xmalloc() are moved\n   from cache.h to git-compat-util.h; cache.h includes\n   git-compat-util.h itself.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n  Junio C Hamano <junkio@cox.net> writes:\n\n  > When I took setenv patch for git.c, I was thinking about\n  > something similar.  It may be cleaner to split out the pieces so\n  > that the functions like usage(), die(), xmalloc() and friends\n  > could be linkable in git.c and others that want to link in only\n  > the minimum set without including \"cache.h\" which has more\n  > intimate knowledge of other git internals.\n\n  Maybe something like this...\n\n Makefile            |   16 ++++---\n cache.h             |   96 -------------------------------------------\n compat/mmap.c       |    2 -\n compat/strcasestr.c |    3 -\n git-compat-util.h   |  113 +++++++++++++++++++++++++++++++++++++++++++++++++++\n git.c               |   15 +++----\n mailinfo.c          |    4 --\n usage.c             |    2 -\n 8 files changed, 132 insertions(+), 119 deletions(-)\n create mode 100644 git-compat-util.h\n\n2823be66bb4a1f6a6b4240e24dfd402e4146c43c\ndiff --git a/Makefile b/Makefile\nindex df3c6eb..1f1088e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -162,7 +162,7 @@ LIB_FILE=libgit.a\n LIB_H = \\\n \tblob.h cache.h commit.h count-delta.h csum-file.h delta.h \\\n \tdiff.h epoch.h object.h pack.h pkt-line.h quote.h refs.h \\\n-\trun-command.h strbuf.h tag.h tree.h\n+\trun-command.h strbuf.h tag.h tree.h git-compat-util.h\n \n DIFF_OBJS = \\\n \tdiff.o diffcore-break.o diffcore-order.o diffcore-pathspec.o \\\n@@ -174,9 +174,11 @@ LIB_OBJS = \\\n \tobject.o pack-check.o patch-delta.o path.o pkt-line.o \\\n \tquote.o read-cache.o refs.o run-command.o \\\n \tserver-info.o setup.o sha1_file.o sha1_name.o strbuf.o \\\n-\ttag.o tree.o usage.o config.o environment.o ctype.o copy.o \\\n+\ttag.o tree.o config.o environment.o copy.o \\\n \t$(DIFF_OBJS)\n \n+COMPAT_OBJS = usage.o ctype.o\n+\n LIBS = $(LIB_FILE)\n LIBS += -lz\n \n@@ -320,15 +322,15 @@ ifdef NEEDS_NSL\n \tSIMPLE_LIB += -lnsl\n endif\n ifdef NO_STRCASESTR\n-\tCOMPAT_CFLAGS += -Dstrcasestr=gitstrcasestr -DNO_STRCASESTR=1\n+\tCOMPAT_CFLAGS += -DNO_STRCASESTR\n \tCOMPAT_OBJS += compat/strcasestr.o\n endif\n ifdef NO_SETENV\n-\tCOMPAT_CFLAGS += -Dsetenv=gitsetenv -DNO_SETENV=1\n+\tCOMPAT_CFLAGS += -DNO_SETENV\n \tCOMPAT_OBJS += compat/setenv.o\n endif\n ifdef NO_MMAP\n-\tCOMPAT_CFLAGS += -Dmmap=gitfakemmap -Dmunmap=gitfakemunmap -DNO_MMAP\n+\tCOMPAT_CFLAGS += -DNO_MMAP\n \tCOMPAT_OBJS += compat/mmap.o\n endif\n ifdef NO_IPV6\n@@ -363,9 +365,9 @@ all: $(ALL_PROGRAMS)\n all:\n \t$(MAKE) -C templates\n \n-git$(X): git.c $(COMPAT_OBJS) Makefile\n+git$X: git.c $(LIB_FILE) Makefile\n \t$(CC) -DGIT_EXEC_PATH='\"$(bindir)\"' -DGIT_VERSION='\"$(GIT_VERSION)\"' \\\n-\t\t$(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(filter %.o,$^)\n+\t\t$(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(LIB_FILE)\n \n $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \trm -f $@\ndiff --git a/cache.h b/cache.h\nindex f9b367f..86fc250 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1,23 +1,7 @@\n #ifndef CACHE_H\n #define CACHE_H\n \n-#include <unistd.h>\n-#include <stdio.h>\n-#include <sys/stat.h>\n-#include <fcntl.h>\n-#include <stddef.h>\n-#include <stdlib.h>\n-#include <stdarg.h>\n-#include <string.h>\n-#include <errno.h>\n-#include <limits.h>\n-#ifndef NO_MMAP\n-#include <sys/mman.h>\n-#endif\n-#include <sys/param.h>\n-#include <netinet/in.h>\n-#include <sys/types.h>\n-#include <dirent.h>\n+#include \"git-compat-util.h\"\n \n #include SHA1_HEADER\n #include <zlib.h>\n@@ -36,15 +20,6 @@\n #define DTYPE(de)\tDT_UNKNOWN\n #endif\n \n-#ifdef __GNUC__\n-#define NORETURN __attribute__((__noreturn__))\n-#else\n-#define NORETURN\n-#ifndef __attribute__\n-#define __attribute__(x)\n-#endif\n-#endif\n-\n /*\n  * Intensive research over the course of many years has shown that\n  * port 9418 is totally unused by anything else. Or\n@@ -250,11 +225,6 @@ extern const char *resolve_ref(const cha\n extern int create_symref(const char *git_HEAD, const char *refs_heads_master);\n extern int validate_symref(const char *git_HEAD);\n \n-/* General helper functions */\n-extern void usage(const char *err) NORETURN;\n-extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));\n-extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));\n-\n extern int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);\n extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2);\n \n@@ -272,30 +242,6 @@ extern int setup_ident(void);\n extern const char *git_author_info(void);\n extern const char *git_committer_info(void);\n \n-static inline void *xmalloc(size_t size)\n-{\n-\tvoid *ret = malloc(size);\n-\tif (!ret)\n-\t\tdie(\"Out of memory, malloc failed\");\n-\treturn ret;\n-}\n-\n-static inline void *xrealloc(void *ptr, size_t size)\n-{\n-\tvoid *ret = realloc(ptr, size);\n-\tif (!ret)\n-\t\tdie(\"Out of memory, realloc failed\");\n-\treturn ret;\n-}\n-\n-static inline void *xcalloc(size_t nmemb, size_t size)\n-{\n-\tvoid *ret = calloc(nmemb, size);\n-\tif (!ret)\n-\t\tdie(\"Out of memory, calloc failed\");\n-\treturn ret;\n-}\n-\n struct checkout {\n \tconst char *base_dir;\n \tint base_dir_len;\n@@ -373,20 +319,6 @@ extern void packed_object_info_detail(st\n /* Dumb servers support */\n extern int update_server_info(int);\n \n-#ifdef NO_MMAP\n-\n-#ifndef PROT_READ\n-#define PROT_READ 1\n-#define PROT_WRITE 2\n-#define MAP_PRIVATE 1\n-#define MAP_FAILED ((void*)-1)\n-#endif\n-\n-extern void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);\n-extern int gitfakemunmap(void *start, size_t length);\n-\n-#endif\n-\n typedef int (*config_fn_t)(const char *, const char *);\n extern int git_default_config(const char *, const char *);\n extern int git_config_from_file(config_fn_t fn, const char *);\n@@ -404,31 +336,5 @@ extern char git_default_name[MAX_GITNAME\n #define MAX_ENCODING_LENGTH 64\n extern char git_commit_encoding[MAX_ENCODING_LENGTH];\n \n-/* Sane ctype - no locale, and works with signed chars */\n-#undef isspace\n-#undef isdigit\n-#undef isalpha\n-#undef isalnum\n-#undef tolower\n-#undef toupper\n-extern unsigned char sane_ctype[256];\n-#define GIT_SPACE 0x01\n-#define GIT_DIGIT 0x02\n-#define GIT_ALPHA 0x04\n-#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)\n-#define isspace(x) sane_istest(x,GIT_SPACE)\n-#define isdigit(x) sane_istest(x,GIT_DIGIT)\n-#define isalpha(x) sane_istest(x,GIT_ALPHA)\n-#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)\n-#define tolower(x) sane_case((unsigned char)(x), 0x20)\n-#define toupper(x) sane_case((unsigned char)(x), 0)\n-\n-static inline int sane_case(int x, int high)\n-{\n-\tif (sane_istest(x, GIT_ALPHA))\n-\t\tx = (x & ~0x20) | high;\n-\treturn x;\n-}\n-\n extern int copy_fd(int ifd, int ofd);\n #endif /* CACHE_H */\ndiff --git a/compat/mmap.c b/compat/mmap.c\nindex a051c47..55cb120 100644\n--- a/compat/mmap.c\n+++ b/compat/mmap.c\n@@ -2,7 +2,7 @@\n #include <stdlib.h>\n #include <unistd.h>\n #include <errno.h>\n-#include \"../cache.h\"\n+#include \"../git-compat-util.h\"\n \n void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset)\n {\ndiff --git a/compat/strcasestr.c b/compat/strcasestr.c\nindex b96414d..26896de 100644\n--- a/compat/strcasestr.c\n+++ b/compat/strcasestr.c\n@@ -1,5 +1,4 @@\n-#include <string.h>\n-#include <ctype.h>\n+#include \"../git-compat-util.h\"\n \n char *gitstrcasestr(const char *haystack, const char *needle)\n {\ndiff --git a/git-compat-util.h b/git-compat-util.h\nnew file mode 100644\nindex 0000000..4185b12\n--- /dev/null\n+++ b/git-compat-util.h\n@@ -0,0 +1,113 @@\n+#ifndef GIT_COMPAT_UTIL_H\n+#define GIT_COMPAT_UTIL_H\n+\n+#include <unistd.h>\n+#include <stdio.h>\n+#include <sys/stat.h>\n+#include <fcntl.h>\n+#include <stddef.h>\n+#include <stdlib.h>\n+#include <stdarg.h>\n+#include <string.h>\n+#include <errno.h>\n+#include <limits.h>\n+#include <sys/param.h>\n+#include <netinet/in.h>\n+#include <sys/types.h>\n+#include <dirent.h>\n+\n+#ifdef __GNUC__\n+#define NORETURN __attribute__((__noreturn__))\n+#else\n+#define NORETURN\n+#ifndef __attribute__\n+#define __attribute__(x)\n+#endif\n+#endif\n+\n+/* General helper functions */\n+extern void usage(const char *err) NORETURN;\n+extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));\n+extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));\n+\n+#ifdef NO_MMAP\n+\n+#ifndef PROT_READ\n+#define PROT_READ 1\n+#define PROT_WRITE 2\n+#define MAP_PRIVATE 1\n+#define MAP_FAILED ((void*)-1)\n+#endif\n+\n+#define mmap gitfakemmap\n+#define munmap gitfakemunmap\n+extern void *gitfakemmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);\n+extern int gitfakemunmap(void *start, size_t length);\n+\n+#else /* NO_MMAP */\n+\n+#include <sys/mman.h>\n+\n+#endif /* NO_MMAP */\n+\n+#ifdef NO_SETENV\n+#define setenv gitsetenv\n+extern int gitsetenv(const char *, const char *, int);\n+#endif\n+\n+#ifdef NO_STRCASESTR\n+#define strcasestr gitstrcasestr\n+extern char *gitstrcasestr(const char *haystack, const char *needle);\n+#endif\n+\n+static inline void *xmalloc(size_t size)\n+{\n+\tvoid *ret = malloc(size);\n+\tif (!ret)\n+\t\tdie(\"Out of memory, malloc failed\");\n+\treturn ret;\n+}\n+\n+static inline void *xrealloc(void *ptr, size_t size)\n+{\n+\tvoid *ret = realloc(ptr, size);\n+\tif (!ret)\n+\t\tdie(\"Out of memory, realloc failed\");\n+\treturn ret;\n+}\n+\n+static inline void *xcalloc(size_t nmemb, size_t size)\n+{\n+\tvoid *ret = calloc(nmemb, size);\n+\tif (!ret)\n+\t\tdie(\"Out of memory, calloc failed\");\n+\treturn ret;\n+}\n+\n+/* Sane ctype - no locale, and works with signed chars */\n+#undef isspace\n+#undef isdigit\n+#undef isalpha\n+#undef isalnum\n+#undef tolower\n+#undef toupper\n+extern unsigned char sane_ctype[256];\n+#define GIT_SPACE 0x01\n+#define GIT_DIGIT 0x02\n+#define GIT_ALPHA 0x04\n+#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)\n+#define isspace(x) sane_istest(x,GIT_SPACE)\n+#define isdigit(x) sane_istest(x,GIT_DIGIT)\n+#define isalpha(x) sane_istest(x,GIT_ALPHA)\n+#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)\n+#define tolower(x) sane_case((unsigned char)(x), 0x20)\n+#define toupper(x) sane_case((unsigned char)(x), 0)\n+\n+static inline int sane_case(int x, int high)\n+{\n+\tif (sane_istest(x, GIT_ALPHA))\n+\t\tx = (x & ~0x20) | high;\n+\treturn x;\n+}\n+\n+#endif\ndiff --git a/git.c b/git.c\nindex ee5048a..c26cac6 100644\n--- a/git.c\n+++ b/git.c\n@@ -8,15 +8,12 @@\n #include <errno.h>\n #include <limits.h>\n #include <stdarg.h>\n+#include \"git-compat-util.h\"\n \n #ifndef PATH_MAX\n # define PATH_MAX 4096\n #endif\n \n-#ifdef NO_SETENV\n-extern int gitsetenv(const char *, const char *, int);\n-#endif\n-\n static const char git_usage[] =\n \t\"Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--help] COMMAND [ ARGS ]\";\n \n@@ -156,10 +153,10 @@ static void list_commands(const char *ex\n }\n \n #ifdef __GNUC__\n-static void usage(const char *exec_path, const char *fmt, ...)\n+static void cmd_usage(const char *exec_path, const char *fmt, ...)\n \t__attribute__((__format__(__printf__, 2, 3), __noreturn__));\n #endif\n-static void usage(const char *exec_path, const char *fmt, ...)\n+static void cmd_usage(const char *exec_path, const char *fmt, ...)\n {\n \tif (fmt) {\n \t\tva_list ap;\n@@ -254,12 +251,12 @@ int main(int argc, char **argv, char **e\n \t\telse if (!strcmp(arg, \"help\"))\n \t\t\tshow_help = 1;\n \t\telse if (!show_help)\n-\t\t\tusage(NULL, NULL);\n+\t\t\tcmd_usage(NULL, NULL);\n \t}\n \n \tif (i >= argc || show_help) {\n \t\tif (i >= argc)\n-\t\t\tusage(exec_path, NULL);\n+\t\t\tcmd_usage(exec_path, NULL);\n \n \t\tshow_man_page(argv[i]);\n \t}\n@@ -297,7 +294,7 @@ int main(int argc, char **argv, char **e\n \texecve(git_command, &argv[i], envp);\n \n \tif (errno == ENOENT)\n-\t\tusage(exec_path, \"'%s' is not a git-command\", argv[i]);\n+\t\tcmd_usage(exec_path, \"'%s' is not a git-command\", argv[i]);\n \n \tfprintf(stderr, \"Failed to run command '%s': %s\\n\",\n \t\tgit_command, strerror(errno));\ndiff --git a/mailinfo.c b/mailinfo.c\nindex 890e348..3b97a89 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -10,10 +10,6 @@\n #include <iconv.h>\n #include \"cache.h\"\n \n-#ifdef NO_STRCASESTR\n-extern char *gitstrcasestr(const char *haystack, const char *needle);\n-#endif\n-\n static FILE *cmitmsg, *patchfile;\n \n static int keep_subject = 0;\ndiff --git a/usage.c b/usage.c\nindex dfa87fe..1fa924c 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -3,7 +3,7 @@\n  *\n  * Copyright (C) Linus Torvalds, 2005\n  */\n-#include \"cache.h\"\n+#include \"git-compat-util.h\"\n \n static void report(const char *prefix, const char *err, va_list params)\n {\n-- \n0.99.9.GIT\n"},{"id":"13215","messageId":"Pine.LNX.4.63.0512052135260.5944@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2748","inReplyTo":"7voe3vb8fh.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-12-05T20:36:05Z","receivedAt":"2005-12-05T20:36:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 5 Dec 2005, Junio C Hamano wrote:\n\n> This attempts to clean up the way various compatibility\n> functions are defined and used.\n\nYou sure you want that before 1.0?\n\nCiao,\nDscho\n"},{"id":"13218","messageId":"7vk6ejb72r.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"Pine.LNX.4.63.0512052135260.5944@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T20:51:56Z","receivedAt":"2005-12-05T20:51:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> This attempts to clean up the way various compatibility\n>> functions are defined and used.\n>\n> You sure you want that before 1.0?\n\nI think this is mostly an obvious clean-up, but I do not have\nenough test environments, so ...\n"},{"id":"13223","messageId":"20051205213612.GA4443@steel.home","threadId":"2748","inReplyTo":"7vfyp7cuii.fsf@assigned-by-dhcp.cox.net","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-05T21:36:12Z","receivedAt":"2005-12-05T21:36:12Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Junio C Hamano, Mon, Dec 05, 2005 18:40:21 +0100:\n> > Why does it always happen...\n> Because you touched you did not absolutely have to ;-).\n\nwell, git$(X) didn't link...\n"},{"id":"13224","messageId":"20051205213929.GB4443@steel.home","threadId":"2748","inReplyTo":"7vk6ejb72r.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-05T21:39:29Z","receivedAt":"2005-12-05T21:39:29Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Junio C Hamano, Mon, Dec 05, 2005 21:51:56 +0100:\n> >> This attempts to clean up the way various compatibility\n> >> functions are defined and used.\n> >\n> > You sure you want that before 1.0?\n> \n> I think this is mostly an obvious clean-up, but I do not have\n> enough test environments, so ...\n\nI will do cygwin. Tomorrow, that is.\n"},{"id":"13225","messageId":"7vvey39pto.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"20051205213612.GA4443@steel.home","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T21:49:55Z","receivedAt":"2005-12-05T21:49:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Junio C Hamano, Mon, Dec 05, 2005 18:40:21 +0100:\n>> > Why does it always happen...\n>> Because you touched you did not absolutely have to ;-).\n>\n> well, git$(X) didn't link...\n\nI meant your change to the \"if ()\" expression in gitfakemmap().\nDoes the change have anything to do with git$X linkage?  I think\nnot.\n"},{"id":"13227","messageId":"20051205215059.GC4443@steel.home","threadId":"2748","inReplyTo":"7voe3vb8fh.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-05T21:50:59Z","receivedAt":"2005-12-05T21:50:59Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Junio C Hamano, Mon, Dec 05, 2005 21:22:42 +0100:\n> This attempts to clean up the way various compatibility\n> functions are defined and used.\n...\n> --- a/compat/mmap.c\n> +++ b/compat/mmap.c\n> @@ -2,7 +2,7 @@\n>  #include <stdlib.h>\n>  #include <unistd.h>\n>  #include <errno.h>\n> -#include \"../cache.h\"\n> +#include \"../git-compat-util.h\"\n\nI still think that compat functions should stand alone.\nEspecially if it does not costs us much (or even less than that).\n"},{"id":"13228","messageId":"7vr78r9pg0.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"20051205215059.GC4443@steel.home","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-05T21:58:07Z","receivedAt":"2005-12-05T21:58:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Junio C Hamano, Mon, Dec 05, 2005 21:22:42 +0100:\n>> This attempts to clean up the way various compatibility\n>> functions are defined and used.\n> ...\n>> --- a/compat/mmap.c\n>> +++ b/compat/mmap.c\n>> @@ -2,7 +2,7 @@\n>>  #include <stdlib.h>\n>>  #include <unistd.h>\n>>  #include <errno.h>\n>> -#include \"../cache.h\"\n>> +#include \"../git-compat-util.h\"\n>\n> I still think that compat functions should stand alone.\n> Especially if it does not costs us much (or even less than that).\n\nSorry, you lost me.  What do you mean by \"standing alone\"?\n"},{"id":"13232","messageId":"20051205231203.GG22159@pasky.or.cz","threadId":"2748","inReplyTo":"7voe3vb8fh.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-12-05T23:12:03Z","receivedAt":"2005-12-05T23:12:03Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Dec 05, 2005 at 09:22:42PM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> diff --git a/git-compat-util.h b/git-compat-util.h\n> new file mode 100644\n\nWhat about compat/util.h or something? Nicer, shorter, and takes\nadvantage of this fancy hierarchical namespace \"directories\" invention.\n;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"13239","messageId":"7vacfe9amx.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"20051205231203.GG22159@pasky.or.cz","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-06T03:17:58Z","receivedAt":"2005-12-06T03:17:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> Dear diary, on Mon, Dec 05, 2005 at 09:22:42PM CET, I got a letter\n> where Junio C Hamano <junkio@cox.net> said that...\n>> diff --git a/git-compat-util.h b/git-compat-util.h\n>> new file mode 100644\n>\n> What about compat/util.h or something? Nicer, shorter, and takes\n> advantage of this fancy hierarchical namespace \"directories\" invention.\n> ;-)\n\nWhile I would appreciate a better name, I am afraid that is not a\nparticularly good one.  It is not \"compatibility utilities\", but\ncompat things and util things mixed together, so it does not\nbelong to compat/ directory to begin with.  die() and friends\nare not about compatibility at all.\n"},{"id":"13248","messageId":"81b0412b0512052315p1917a04ek264c14abf41a1027@mail.gmail.com","threadId":"2748","inReplyTo":"7vr78r9pg0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-06T07:15:16Z","receivedAt":"2005-12-06T07:15:16Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 12/5/05, Junio C Hamano <junkio@cox.net> wrote:\n> >> This attempts to clean up the way various compatibility\n> >> functions are defined and used.\n> >> --- a/compat/mmap.c\n> >> +++ b/compat/mmap.c\n> >\n> > I still think that compat functions should stand alone.\n> > Especially if it does not costs us much (or even less than that).\n> Sorry, you lost me.  What do you mean by \"standing alone\"?\n\nDo not depend nor use anything from the calling code (do not take\nanything from git). If it has to serve as compatibility wrapper to\nmmap, it better should be mmap(2): return MAP_FAILED if error, do not\nexit process, do no output. I wouldn't expect open(2) to print \"File\nnot found\", would you?\n\nBesides, MAP_FAILED is perfectly handled in calling layers. If they\neven print out errno, the case is completely covered and simplier\nhandled.\n"},{"id":"13249","messageId":"7vk6ei65r6.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"81b0412b0512052315p1917a04ek264c14abf41a1027@mail.gmail.com","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-06T07:31:41Z","receivedAt":"2005-12-06T07:31:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> ... return MAP_FAILED if error, do not\n> exit process, do no output.\n\nAh, that is what you meant.  I agree.\n"},{"id":"13251","messageId":"81b0412b0512052335i43da5d34xf2ef78e66e40c6ee@mail.gmail.com","threadId":"2748","inReplyTo":"20051205213929.GB4443@steel.home","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-06T07:35:19Z","receivedAt":"2005-12-06T07:35:19Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 12/5/05, Alex Riesen <raa.lkml@gmail.com> wrote:\n> Junio C Hamano, Mon, Dec 05, 2005 21:51:56 +0100:\n> > >> This attempts to clean up the way various compatibility\n> > >> functions are defined and used.\n> > >\n> > > You sure you want that before 1.0?\n> >\n> > I think this is mostly an obvious clean-up, but I do not have\n> > enough test environments, so ...\n> I will do cygwin. Tomorrow, that is.\n\nThe patch works on cygwin. I let the tests run, too.\n"},{"id":"13253","messageId":"81b0412b0512052349u56cba9d9s98d6c8594c54a398@mail.gmail.com","threadId":"2748","inReplyTo":"7vvey39pto.fsf@assigned-by-dhcp.cox.net","subject":"Re: make gitfakemmap standalone to fix linking error in git.c","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-06T07:49:09Z","receivedAt":"2005-12-06T07:49:09Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 12/5/05, Junio C Hamano <junkio@cox.net> wrote:\n> >> > Why does it always happen...\n> >> Because you touched you did not absolutely have to ;-).\n> >\n> > well, git$(X) didn't link...\n>\n> I meant your change to the \"if ()\" expression in gitfakemmap().\n> Does the change have anything to do with git$X linkage?  I think\n> not.\n\nOh, yes. Sorry. Too much sorries recently :(\n"},{"id":"13254","messageId":"7v8xuy64id.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"81b0412b0512052335i43da5d34xf2ef78e66e40c6ee@mail.gmail.com","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-06T07:58:34Z","receivedAt":"2005-12-06T07:58:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> On 12/5/05, Alex Riesen <raa.lkml@gmail.com> wrote:\n>> Junio C Hamano, Mon, Dec 05, 2005 21:51:56 +0100:\n>> > >> This attempts to clean up the way various compatibility\n>> > >> functions are defined and used.\n>> > >\n>> > > You sure you want that before 1.0?\n>> >\n>> > I think this is mostly an obvious clean-up, but I do not have\n>> > enough test environments, so ...\n>> I will do cygwin. Tomorrow, that is.\n>\n> The patch works on cygwin. I let the tests run, too.\n\nThanks.  I've had a chance to try the one in the \"master\" branch\non cygwin myself today and it seemed to work OK.  I did a\npartial build on Solaris 5.9 as well.\n"},{"id":"13255","messageId":"81b0412b0512060007s589e1d0dr4f47da68a7f3567a@mail.gmail.com","threadId":"2748","inReplyTo":"7vk6ei65r6.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2005-12-06T08:07:04Z","receivedAt":"2005-12-06T08:07:04Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 12/6/05, Junio C Hamano <junkio@cox.net> wrote:\n> > ... return MAP_FAILED if error, do not\n> > exit process, do no output.\n> Ah, that is what you meant.  I agree.\n\nnow, while we agree, how about the patch removing \"user interface\"\nfrom gitfakemmap altogether? The patch is not really tested (running\ntests is not useful in this case), but I looked over the call sites,\nand they seem either to handle mmap's or the previous open's return\nvalues.\nOne exception is in config.c where neither is handled, the code will\nrace between stat and open.\n\nSigned-off-by: Alex Riesen <fork0@gmail.com>\n\n\ncleanup mmap fake. No need to output anything, callers handle the return value\n\nSigned-off-by: Alex Riesen <fork0@gmail.com>\n\n---\n\n compat/mmap.c |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\n311da12b7aaca9b7329a07807e1ce4afba4bff77\ndiff --git a/compat/mmap.c b/compat/mmap.c\nindex 55cb120..32d7a30 100644\n--- a/compat/mmap.c\n+++ b/compat/mmap.c\n@@ -8,15 +8,17 @@ void *gitfakemmap(void *start, size_t le\n {\n \tint n = 0;\n \n-\tif (start != NULL || !(flags & MAP_PRIVATE))\n-\t\tdie(\"Invalid usage of gitfakemmap.\");\n+\tif (start != NULL || !(flags & MAP_PRIVATE)) {\n+\t\terrno = ENOTSUP;\n+\t\treturn MAP_FAILED;\n+\t}\n \n \tif (lseek(fd, offset, SEEK_SET) < 0) {\n \t\terrno = EINVAL;\n \t\treturn MAP_FAILED;\n \t}\n \n-\tstart = xmalloc(length);\n+\tstart = malloc(length);\n \tif (start == NULL) {\n \t\terrno = ENOMEM;\n \t\treturn MAP_FAILED;\n-- \n0.99.9.GIT\n"},{"id":"13256","messageId":"7vu0dm4pbm.fsf@assigned-by-dhcp.cox.net","threadId":"2748","inReplyTo":"81b0412b0512060007s589e1d0dr4f47da68a7f3567a@mail.gmail.com","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-06T08:11:57Z","receivedAt":"2005-12-06T08:11:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> On 12/6/05, Junio C Hamano <junkio@cox.net> wrote:\n>> > ... return MAP_FAILED if error, do not\n>> > exit process, do no output.\n>> Ah, that is what you meant.  I agree.\n>\n> now, while we agree, how about the patch removing \"user interface\"\n> from gitfakemmap altogether?\n\n> 311da12b7aaca9b7329a07807e1ce4afba4bff77\n> diff --git a/compat/mmap.c b/compat/mmap.c\n> index 55cb120..32d7a30 100644\n> --- a/compat/mmap.c\n> +++ b/compat/mmap.c\n> @@ -8,15 +8,17 @@ void *gitfakemmap(void *start, size_t le\n>  {\n>  \tint n = 0;\n>  \n> -\tif (start != NULL || !(flags & MAP_PRIVATE))\n> -\t\tdie(\"Invalid usage of gitfakemmap.\");\n> +\tif (start != NULL || !(flags & MAP_PRIVATE)) {\n> +\t\terrno = ENOTSUP;\n> +\t\treturn MAP_FAILED;\n> +\t}\n\nI've considered this one after hearing what you meant by your\nprevious comment, but I am slightly in favor of keeping this\ndie(); what would trigger this is a programmer error, and the\nextra error message from die() makes it obvious, although I\nagree that it is unclean from purist point of view.\n\nOn the other hand,\n\n> -\tstart = xmalloc(length);\n> +\tstart = malloc(length);\n\nThis one I'd agree with 100%.\n"},{"id":"13262","messageId":"20051206095314.GZ10680@pasky.or.cz","threadId":"2748","inReplyTo":"7vacfe9amx.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clean up compatibility definitions.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-12-06T09:53:14Z","receivedAt":"2005-12-06T09:53:14Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Dec 06, 2005 at 04:17:58AM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > Dear diary, on Mon, Dec 05, 2005 at 09:22:42PM CET, I got a letter\n> > where Junio C Hamano <junkio@cox.net> said that...\n> >> diff --git a/git-compat-util.h b/git-compat-util.h\n> >> new file mode 100644\n> >\n> > What about compat/util.h or something? Nicer, shorter, and takes\n> > advantage of this fancy hierarchical namespace \"directories\" invention.\n> > ;-)\n> \n> While I would appreciate a better name, I am afraid that is not a\n> particularly good one.  It is not \"compatibility utilities\", but\n> compat things and util things mixed together, so it does not\n> belong to compat/ directory to begin with.  die() and friends\n> are not about compatibility at all.\n\nThen perhaps the .h file should be split? At least the \"compat-util\"\nname did not suggest combination to me, but specialization (not\n\"compatibility and utils\" but \"compatibility utils\").\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"}]}