{"thread":{"id":"2985","subject":"[ANNOUNCE] GIT 1.0.7","startedAt":"2006-01-07T07:01:34Z","lastAt":"2006-01-07T21:30:28Z","messageCount":11,"participants":["Junio C Hamano","YOSHIFUJI Hideaki / 吉藤英明","David S. Miller","Sergey Vlasov","H. Peter Anvin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14225","messageId":"7vhd8go71t.fsf@assigned-by-dhcp.cox.net","threadId":"2985","inReplyTo":null,"subject":"[ANNOUNCE] GIT 1.0.7","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-07T07:01:34Z","receivedAt":"2006-01-07T07:01:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"GIT 1.0.7 is available at http://www.kernel.org/pub/software/scm/git/\n\nJust bunch of cleanups, documentation formatting and spelling\nfixes, among them notable are:\n\n - git-format-patch and git-commit now handles author names with\n   ' (ASCII 0x27, single quote) character in them properly.\n\n - approxidate parser does not get confused when we say \"10 days\n   ago\" immediately after new year.\n\n\nThe master branch has accumulated enough enhancements, and I\nplan to do GIT 1.1.0 (and start 1.1.X maintenance series) over\nthe weekend.  What will be there are listed here, but those who\nhave been running the \"master\" branch must be familiar with most\nof them.\n\n\nJohannes Schindelin:\n      git-clone: Support changing the origin branch with -o\n      Introduce core.sharedrepository\n      git-init-db: initialize shared repositories with --shared\n\nJohn Ellson:\n      Make GIT-VERSION-GEN tolerate missing git describe command\n\nJunio C Hamano:\n      Versioning scheme changes.\n      merge-recursive: conflicting rename case.\n      whatchanged: customize diff-tree output\n      rev-parse: --show-cdup\n      check_packed_git_idx(): check integrity of the idx file itself.\n      checkout: sometimes work from a subdirectory.\n      ls-tree: chomp leading directories when run from a subdirectory\n      git-clone: do not special case dumb http.\n      Tutorial: mention shared repository management.\n      git-describe: really prefer tags only.\n      git-describe: use find_unique_abbrev()\n      git-describe: --tags and --abbrev\n      git-describe: still prefer annotated tag under --all and --tags\n      git-describe: documentation.\n      Makefile: use git-describe to mark the git version.\n      send-pack/receive-pack: allow errors to be reported back to pusher.\n\nLinus Torvalds:\n      Add a \"git-describe\" command\n\nLukas Sandstrom:\n      git-pack-redundant: speed and memory usage improvements\n\nYOSHIFUJI Hideaki:\n      GIT: Support [address] in URLs\n"},{"id":"14227","messageId":"20060107.021614.94523887.yoshfuji@linux-ipv6.org","threadId":"2985","inReplyTo":"7vhd8go71t.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"YOSHIFUJI Hideaki / 吉藤英明","fromEmail":"yoshfuji@linux-ipv6.org","sentAt":"2006-01-07T08:16:14Z","receivedAt":"2006-01-07T08:16:14Z","isPatch":false,"sender":{"key":"yoshfuji@linux-ipv6.org","avatar":"https://gravatar.com/avatar/92c288bb8d3e34afd7bb1574cc1079a3d0aa6d36d80955d1ec6a1cea2868d392?d=mp&s=160"},"body":"In article <7vhd8go71t.fsf@assigned-by-dhcp.cox.net> (at Fri, 06 Jan 2006 23:01:34 -0800), Junio C Hamano <junkio@cox.net> says:\n\n> GIT 1.0.7 is available at http://www.kernel.org/pub/software/scm/git/\n\nAllow compilation w/ gcc 2.95.4.\n(Or, it is okay to replace path[] with path[0].)\n\nSigned-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>\n\ndiff --git a/describe.c b/describe.c\nindex 84d96b5..3688c4a 100644\n--- a/describe.c\n+++ b/describe.c\n@@ -17,8 +17,8 @@ static int abbrev = DEFAULT_ABBREV;\n static int names = 0, allocs = 0;\n static struct commit_name {\n \tconst struct commit *commit;\n+\tchar *path;\n \tint prio; /* annotated tag = 2, tag = 1, head = 0 */\n-\tchar path[];\n } **name_array = NULL;\n \n static struct commit_name *match(struct commit *cmit)\n@@ -43,6 +43,7 @@ static void add_to_known_names(const cha\n \tstruct commit_name *name = xmalloc(sizeof(struct commit_name) + len);\n \n \tname->commit = commit;\n+\tname->path = sizeof(*name);\n \tname->prio = prio; \n \tmemcpy(name->path, path, len);\n \tidx = names;\n\n-- \nYOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>\nGPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA\n"},{"id":"14228","messageId":"20060107.002904.87767885.davem@davemloft.net","threadId":"2985","inReplyTo":"20060107.021614.94523887.yoshfuji@linux-ipv6.org","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"David S. Miller","fromEmail":"davem@davemloft.net","sentAt":"2006-01-07T08:29:04Z","receivedAt":"2006-01-07T08:29:04Z","isPatch":false,"sender":{"key":"davem@davemloft.net","avatar":null},"body":"From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>\nDate: Sat, 07 Jan 2006 02:16:14 -0600 (CST)\n\n> @@ -43,6 +43,7 @@ static void add_to_known_names(const cha\n>  \tstruct commit_name *name = xmalloc(sizeof(struct commit_name) + len);\n>  \n>  \tname->commit = commit;\n> +\tname->path = sizeof(*name);\n>  \tname->prio = prio; \n>  \tmemcpy(name->path, path, len);\n>  \tidx = names;\n\nWhy are you assigning an integer to a pointer? :-)\nProbably you meant something like:\n\n\tstruct commit_name *name = xmalloc(sizeof(struct commit_name) + len);\n\n\t...\n\tname->path = xmalloc(len);\n\t...\n"},{"id":"14230","messageId":"20060107.023327.18175855.yoshfuji@linux-ipv6.org","threadId":"2985","inReplyTo":"20060107.002904.87767885.davem@davemloft.net","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"YOSHIFUJI Hideaki / 吉藤英明","fromEmail":"yoshfuji@linux-ipv6.org","sentAt":"2006-01-07T08:33:27Z","receivedAt":"2006-01-07T08:33:27Z","isPatch":false,"sender":{"key":"yoshfuji@linux-ipv6.org","avatar":"https://gravatar.com/avatar/92c288bb8d3e34afd7bb1574cc1079a3d0aa6d36d80955d1ec6a1cea2868d392?d=mp&s=160"},"body":"In article <20060107.002904.87767885.davem@davemloft.net> (at Sat, 07 Jan 2006 00:29:04 -0800 (PST)), \"David S. Miller\" <davem@davemloft.net> says:\n\n> >  \tname->commit = commit;\n> > +\tname->path = sizeof(*name);\n> >  \tname->prio = prio; \n\n> Why are you assigning an integer to a pointer? :-)\n> Probably you meant something like:\n> \n> \tstruct commit_name *name = xmalloc(sizeof(struct commit_name) + len);\n> \n> \t...\n> \tname->path = xmalloc(len);\n> \t...\n\noops.... you're right...\n\n--yoshfuji @ about to fly\n"},{"id":"14232","messageId":"7vsls0mns8.fsf@assigned-by-dhcp.cox.net","threadId":"2985","inReplyTo":"20060107.021614.94523887.yoshfuji@linux-ipv6.org","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-07T08:43:03Z","receivedAt":"2006-01-07T08:43:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"[Yoshifuji-san, you will see this message twice but everybody\nelse would not --- I removed your Japanese name from the body of\nthe message, to pass mail filter at kernel.org]\n\nYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> writes:\n\n> Allow compilation w/ gcc 2.95.4.\n> (Or, it is okay to replace path[] with path[0].)\n\nThis is unfortunate; path[] is the correct C (and path[0] is\nnot---it is an gcc extension), and we have quite a few of them.\nLast time somebody wanted to change all of them to path[] we\nfound out gcc 2.95 did not like it, and ended up doing path[0]\nform.  So I'd say change it to path[0] for now.\n"},{"id":"14236","messageId":"7vmzi8mkdi.fsf@assigned-by-dhcp.cox.net","threadId":"2985","inReplyTo":"7vsls0mns8.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-07T09:56:41Z","receivedAt":"2006-01-07T09:56:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> writes:\n>\n>> Allow compilation w/ gcc 2.95.4.\n>> (Or, it is okay to replace path[] with path[0].)\n>\n> This is unfortunate; path[] is the correct C (and path[0] is\n> not---it is an gcc extension), and we have quite a few of them.\n> Last time somebody wanted to change all of them to path[] we\n> found out gcc 2.95 did not like it, and ended up doing path[0]\n> form.  So I'd say change it to path[0] for now.\n\nHere is what I am planning to merge into the master/maint.  The\npatch is for maint which does not ship with describe, but the\nproblematic path[] can be updated to path[FLEX_ARRAY] as others\nwhen merging it to the master branch.\n\n-- >8 --\nSubject: [PATCH] Compilation: zero-length array declaration.\n\nISO C99 (and GCC 3.x or later) lets you write a flexible array\nat the end of a structure, like this:\n\n\tstruct frotz {\n\t\tint xyzzy;\n\t\tchar nitfol[]; /* more */\n\t};\n\nGCC 2.95 lets you to do this with \"char nitfol[0]\";\nunfortunately this is not allowed by ISO C90.\n\nThis declares such construct like this:\n\n\tstruct frotz {\n\t\tint xyzzy;\n\t\tchar nitfol[FLEX_ARRAY]; /* more */\n\t};\n\nand git-compat-util.h defines FLEX_ARRAY to 0 for gcc 2.95 and\nempty for others.\n\nAlthough I have not tried this myself, if you are using a C90 C\ncompiler, you should be able to override this with\nCFLAGS=-DFLEX_ARRAY=1 from the command line of \"make\".\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n blob.c            |    2 +-\n cache.h           |    9 +++++----\n commit.c          |    2 +-\n git-compat-util.h |    8 ++++++++\n ls-files.c        |    2 +-\n object.c          |    2 +-\n object.h          |    2 +-\n receive-pack.c    |    2 +-\n tag.c             |    2 +-\n tree.c            |    2 +-\n 10 files changed, 21 insertions(+), 12 deletions(-)\n\n33751f1c4e23e928f18a019292cb8562cd7c7f76\ndiff --git a/blob.c b/blob.c\nindex ea52ad5..84ec121 100644\n--- a/blob.c\n+++ b/blob.c\n@@ -1,5 +1,5 @@\n-#include \"blob.h\"\n #include \"cache.h\"\n+#include \"blob.h\"\n #include <stdlib.h>\n \n const char *blob_type = \"blob\";\ndiff --git a/cache.h b/cache.h\nindex cb87bec..5fd2687 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -81,7 +81,7 @@ struct cache_entry {\n \tunsigned int ce_size;\n \tunsigned char sha1[20];\n \tunsigned short ce_flags;\n-\tchar name[0];\n+\tchar name[FLEX_ARRAY]; /* more */\n };\n \n #define CE_NAMEMASK  (0x0fff)\n@@ -257,7 +257,7 @@ extern int checkout_entry(struct cache_e\n extern struct alternate_object_database {\n \tstruct alternate_object_database *next;\n \tchar *name;\n-\tchar base[0]; /* more */\n+\tchar base[FLEX_ARRAY]; /* more */\n } *alt_odb_list;\n extern void prepare_alt_odb(void);\n \n@@ -271,7 +271,8 @@ extern struct packed_git {\n \tunsigned int pack_use_cnt;\n \tint pack_local;\n \tunsigned char sha1[20];\n-\tchar pack_name[0]; /* something like \".git/objects/pack/xxxxx.pack\" */\n+\t/* something like \".git/objects/pack/xxxxx.pack\" */\n+\tchar pack_name[FLEX_ARRAY]; /* more */\n } *packed_git;\n \n struct pack_entry {\n@@ -286,7 +287,7 @@ struct ref {\n \tunsigned char new_sha1[20];\n \tunsigned char force;\n \tstruct ref *peer_ref; /* when renaming */\n-\tchar name[0];\n+\tchar name[FLEX_ARRAY]; /* more */\n };\n \n extern int git_connect(int fd[2], char *url, const char *prog);\ndiff --git a/commit.c b/commit.c\nindex edd4ded..fb02ba6 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1,6 +1,6 @@\n+#include \"cache.h\"\n #include \"tag.h\"\n #include \"commit.h\"\n-#include \"cache.h\"\n \n int save_commit_buffer = 1;\n \ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex c353b27..1a263a6 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -1,6 +1,14 @@\n #ifndef GIT_COMPAT_UTIL_H\n #define GIT_COMPAT_UTIL_H\n \n+#ifndef FLEX_ARRAY\n+#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)\n+#define FLEX_ARRAY 0\n+#else\n+#define FLEX_ARRAY /* empty */\n+#endif\n+#endif\n+\n #include <unistd.h>\n #include <stdio.h>\n #include <sys/stat.h>\ndiff --git a/ls-files.c b/ls-files.c\nindex cd87430..74ec8c0 100644\n--- a/ls-files.c\n+++ b/ls-files.c\n@@ -208,7 +208,7 @@ static int excluded(const char *pathname\n \n struct nond_on_fs {\n \tint len;\n-\tchar name[0];\n+\tchar name[FLEX_ARRAY]; /* more */\n };\n \n static struct nond_on_fs **dir;\ndiff --git a/object.c b/object.c\nindex cf5931a..1577f74 100644\n--- a/object.c\n+++ b/object.c\n@@ -1,8 +1,8 @@\n+#include \"cache.h\"\n #include \"object.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n #include \"commit.h\"\n-#include \"cache.h\"\n #include \"tag.h\"\n \n struct object **objs;\ndiff --git a/object.h b/object.h\nindex 336d986..0e76182 100644\n--- a/object.h\n+++ b/object.h\n@@ -9,7 +9,7 @@ struct object_list {\n \n struct object_refs {\n \tunsigned count;\n-\tstruct object *ref[0];\n+\tstruct object *ref[FLEX_ARRAY]; /* more */\n };\n \n struct object {\ndiff --git a/receive-pack.c b/receive-pack.c\nindex 92878ec..ce986fe 100644\n--- a/receive-pack.c\n+++ b/receive-pack.c\n@@ -24,7 +24,7 @@ struct command {\n \tunsigned char updated;\n \tunsigned char old_sha1[20];\n \tunsigned char new_sha1[20];\n-\tchar ref_name[0];\n+\tchar ref_name[FLEX_ARRAY]; /* more */\n };\n \n static struct command *commands = NULL;\ndiff --git a/tag.c b/tag.c\nindex 61ac434..ac0e573 100644\n--- a/tag.c\n+++ b/tag.c\n@@ -1,5 +1,5 @@\n-#include \"tag.h\"\n #include \"cache.h\"\n+#include \"tag.h\"\n \n const char *tag_type = \"tag\";\n \ndiff --git a/tree.c b/tree.c\nindex e7a7b71..dc1c41e 100644\n--- a/tree.c\n+++ b/tree.c\n@@ -1,8 +1,8 @@\n+#include \"cache.h\"\n #include \"tree.h\"\n #include \"blob.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n-#include \"cache.h\"\n #include <stdlib.h>\n \n const char *tree_type = \"tree\";\n-- \n1.0.7-g0263\n"},{"id":"14247","messageId":"20060107151244.762e628f.vsu@altlinux.ru","threadId":"2985","inReplyTo":"7vmzi8mkdi.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2006-01-07T12:12:44Z","receivedAt":"2006-01-07T12:12:44Z","isPatch":false,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"On Sat, 07 Jan 2006 01:56:41 -0800 Junio C Hamano wrote:\n\n> +#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)\n> +#define FLEX_ARRAY 0\n> +#else\n> +#define FLEX_ARRAY /* empty */\n> +#endif\n\nThere is also gcc 2.96, which also does not understand the C99 syntax.\nSo we should use something like this instead:\n\n#if defined(__GNUC__) && (__GNUC__ < 3)\n#define FLEX_ARRAY 0\n#else\n#define FLEX_ARRAY /* empty */\n#endif\n\n(and be prepared to get complaints from users of other compilers).\n"},{"id":"14254","messageId":"7voe2nki5l.fsf@assigned-by-dhcp.cox.net","threadId":"2985","inReplyTo":"20060107151244.762e628f.vsu@altlinux.ru","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-07T18:27:34Z","receivedAt":"2006-01-07T18:27:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergey Vlasov <vsu@altlinux.ru> writes:\n\n> There is also gcc 2.96, which also does not understand the C99 syntax.\n> So we should use something like this instead:\n>\n> #if defined(__GNUC__) && (__GNUC__ < 3)\n> #define FLEX_ARRAY 0\n> #else\n> #define FLEX_ARRAY /* empty */\n> #endif\n>\n> (and be prepared to get complaints from users of other compilers).\n\nThanks.\n"},{"id":"14260","messageId":"43C028CA.8090702@zytor.com","threadId":"2985","inReplyTo":"7vmzi8mkdi.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2006-01-07T20:47:06Z","receivedAt":"2006-01-07T20:47:06Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Junio C Hamano wrote:\n> \n> Here is what I am planning to merge into the master/maint.  The\n> patch is for maint which does not ship with describe, but the\n> problematic path[] can be updated to path[FLEX_ARRAY] as others\n> when merging it to the master branch.\n> \n> -- >8 --\n> Subject: [PATCH] Compilation: zero-length array declaration.\n> \n> ISO C99 (and GCC 3.x or later) lets you write a flexible array\n> at the end of a structure, like this:\n> \n> \tstruct frotz {\n> \t\tint xyzzy;\n> \t\tchar nitfol[]; /* more */\n> \t};\n> \n> GCC 2.95 lets you to do this with \"char nitfol[0]\";\n> unfortunately this is not allowed by ISO C90.\n> \n> This declares such construct like this:\n> \n> \tstruct frotz {\n> \t\tint xyzzy;\n> \t\tchar nitfol[FLEX_ARRAY]; /* more */\n> \t};\n> \n> and git-compat-util.h defines FLEX_ARRAY to 0 for gcc 2.95 and\n> empty for others.\n> \n> Although I have not tried this myself, if you are using a C90 C\n> compiler, you should be able to override this with\n> CFLAGS=-DFLEX_ARRAY=1 from the command line of \"make\".\n> \n\nAny reason to not just do:\n\n  \tstruct frotz {\n  \t\tint xyzzy;\n  \t\tchar nitfol[1]; /* more */\n  \t};\n\n... which should work on all compilers?\n\n\t-hpa\n"},{"id":"14264","messageId":"7vlkxreo9e.fsf@assigned-by-dhcp.cox.net","threadId":"2985","inReplyTo":"43C028CA.8090702@zytor.com","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-07T21:12:13Z","receivedAt":"2006-01-07T21:12:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"H. Peter Anvin\" <hpa@zytor.com> writes:\n\n> Any reason to not just do:\n>\n>  \tstruct frotz {\n>  \t\tint xyzzy;\n>  \t\tchar nitfol[1]; /* more */\n>  \t};\n>\n> ... which should work on all compilers?\n\nLaziness, especially to avoid having to deal with comments like\n\"your xmalloc(sizeof(struct frotz) + strlen(nitfol) + 1) should be\nxmalloc(sizeof(struct frotz) + strlen(nitfol)), because you\nhave already one byte for nitfol element.\"\n"},{"id":"14265","messageId":"43C032F4.9030104@zytor.com","threadId":"2985","inReplyTo":"7vlkxreo9e.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.0.7","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2006-01-07T21:30:28Z","receivedAt":"2006-01-07T21:30:28Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Junio C Hamano wrote:\n> \"H. Peter Anvin\" <hpa@zytor.com> writes:\n> \n> \n>>Any reason to not just do:\n>>\n>> \tstruct frotz {\n>> \t\tint xyzzy;\n>> \t\tchar nitfol[1]; /* more */\n>> \t};\n>>\n>>... which should work on all compilers?\n> \n> Laziness, especially to avoid having to deal with comments like\n> \"your xmalloc(sizeof(struct frotz) + strlen(nitfol) + 1) should be\n> xmalloc(sizeof(struct frotz) + strlen(nitfol)), because you\n> have already one byte for nitfol element.\"\n> \n\nIn the case of strings, that's probably a blessing (already accounted \nfor the null byte).\n\n\t-hpa\n"}]}