{"thread":{"id":"14176","subject":"octopus limit","startedAt":"2008-06-27T02:44:23Z","lastAt":"2008-06-27T17:46:43Z","messageCount":9,"participants":["Len Brown","Matthieu Moy","Johannes Schindelin","Johannes Sixt","Miklos Vajna","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"81352","messageId":"alpine.LFD.1.10.0806262243130.2988@localhost.localdomain","threadId":"14176","inReplyTo":null,"subject":"octopus limit","fromName":"Len Brown","fromEmail":"lenb@kernel.org","sentAt":"2008-06-27T02:44:23Z","receivedAt":"2008-06-27T02:44:23Z","isPatch":false,"sender":{"key":"lenb@kernel.org","avatar":null},"body":"it would be nice if a merge of more than 16 branches failed\nright at the start, rather than chunking along doing merges\nand then giving up, leaving my repo in an intermediate state.\n\ncheers,\n-len\n\ngit merge test acpica bugzilla-10807-v2 bugzilla-10927 bugzilla-6217 \nbugzilla-9684 bugzilla-9704 bugzilla-9772 compal-laptop debug-test \ndev-printk fujitsu-laptop gpe-debug misc per-cpu pnp-v3 suspend wmi-2.6.27\nAlready up-to-date with c4e6a2e64e948de42473e9c829181d768b1258c3\nTrying simple merge with aa10d9f35361d3b260750f305ba8eb41c78e1a29\nTrying simple merge with 23ac069d8be58c314af149dca2bb42dafdc38069\nTrying simple merge with 60d40a50886415040888bde5133ccfeab40d945f\nTrying simple merge with a7f34ae2abc9cb51a5b906f2da0aaa697f1a8883\nSimple merge did not work, trying automatic merge.\nAuto-merging drivers/acpi/events/evgpe.c\nTrying simple merge with 009733ab59c05c4331c5504001587562e66a0d2b\nTrying simple merge with 7004cf59cbfa54bc5ef0b3c5e0f81af410365e07\nTrying simple merge with ad7f0d9feee6980a3ab3ea806854f56817d1da8e\nSimple merge did not work, trying automatic merge.\nAuto-merging drivers/acpi/processor_core.c\nAuto-merging drivers/acpi/scan.c\nAuto-merging kernel/cpu.c\nTrying simple merge with 46c636862ee7e2f45e3369393f7c00761727e674\nSimple merge did not work, trying automatic merge.\nAuto-merging MAINTAINERS\nTrying simple merge with 9e030ab0bffdc8b6d8be663b639bd5e2374537f0\nSimple merge did not work, trying automatic merge.\nAuto-merging drivers/acpi/namespace/nsxfeval.c\nAuto-merging drivers/acpi/utilities/utmisc.c\nTrying simple merge with 48e25157d315ec5fed3f5e1db88119dcde6175ea\nTrying simple merge with 770c091f85a922d92505e2da8b30cf30dd6bc2f3\nSimple merge did not work, trying automatic merge.\nAuto-merging MAINTAINERS\nAuto-merging drivers/misc/Kconfig\nTrying simple merge with bb9babebc64541307d2eca41ed8e4c977f4beb10\nSimple merge did not work, trying automatic merge.\nAuto-merging drivers/acpi/hardware/hwgpe.c\nAuto-merging include/acpi/achware.h\nAuto-merging include/acpi/acpixf.h\nTrying simple merge with eac9c2dc06e1ea25efebcd3d508c0ae40f4a9ece\nSimple merge did not work, trying automatic merge.\nAuto-merging include/acpi/aclocal.h\nTrying simple merge with e1d755bbddba413c4050db1bfbe1f7e17dee3002\nSimple merge did not work, trying automatic merge.\nAuto-merging drivers/acpi/processor_core.c\nAuto-merging drivers/acpi/processor_idle.c\nAuto-merging drivers/acpi/processor_throttling.c\nAuto-merging include/acpi/processor.h\nTrying simple merge with f382348d43f80b6267a0881729366be2e5542ace\nTrying simple merge with a143f92aca5eaf9a4ac608f7d208592e514574ed\nSimple merge did not work, trying automatic merge.\nAuto-merging drivers/acpi/sleep/main.c\nTrying simple merge with 1a76b5a83e977cee4cd27c2f45a239a5faa9c1cc\nfatal: Too many parents (16 max)\n"},{"id":"81365","messageId":"vpqbq1n5qv2.fsf@bauges.imag.fr","threadId":"14176","inReplyTo":"alpine.LFD.1.10.0806262243130.2988@localhost.localdomain","subject":"Re: octopus limit","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-06-27T06:33:37Z","receivedAt":"2008-06-27T06:33:37Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Len Brown <lenb@kernel.org> writes:\n\n> it would be nice if a merge of more than 16 branches failed\n> right at the start, rather than chunking along doing merges\n> and then giving up, leaving my repo in an intermediate state.\n\nThere's a patch around which should remove this limitation (I think\nit's the builtin-ification of merge).\n\n-- \nMatthieu\n"},{"id":"81379","messageId":"alpine.DEB.1.00.0806271259440.9925@racer","threadId":"14176","inReplyTo":"alpine.LFD.1.10.0806262243130.2988@localhost.localdomain","subject":"Re: octopus limit","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-27T12:00:56Z","receivedAt":"2008-06-27T12:00:56Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 26 Jun 2008, Len Brown wrote:\n\n> it would be nice if a merge of more than 16 branches failed right at the \n> start, rather than chunking along doing merges and then giving up, \n> leaving my repo in an intermediate state.\n\nFWIW I think the rewrite of git-merge as a builtin, which is currently in \nthe works, lifts the limit.  However, this is only true if you do not use \na custom script which calls commit-tree.\n\nCiao,\nDscho\n"},{"id":"81381","messageId":"alpine.DEB.1.00.0806271324010.9925@racer","threadId":"14176","inReplyTo":"alpine.DEB.1.00.0806271259440.9925@racer","subject":"[PATCH] commit-tree: lift completely arbitrary limit of 16 parents","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-27T12:24:47Z","receivedAt":"2008-06-27T12:24:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThere is no really good reason to have a merge with more than 16\nparents, but we have a history of giving our users rope.\n\nCombined with the fact that there was no good reason for that\narbitrary limit in the first place, here is an all-too-easy to fix.\n\nKind of wished-for by Len Brown.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Fri, 27 Jun 2008, Johannes Schindelin wrote:\n\n\t> On Thu, 26 Jun 2008, Len Brown wrote:\n\t> \n\t> > it would be nice if a merge of more than 16 branches failed \n\t> > right at the start, rather than chunking along doing merges and then \n\t> > giving up, leaving my repo in an intermediate state.\n\t> \n\t> FWIW I think the rewrite of git-merge as a builtin, which is \n\t> currently in the works, lifts the limit.  However, this is only true if \n\t> you do not use a custom script which calls commit-tree.\n\n\tAnd here is a patch to fix commit-tree.\n\n builtin-commit-tree.c |   43 ++++++++++++++++++++-----------------------\n 1 files changed, 20 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin-commit-tree.c b/builtin-commit-tree.c\nindex e5e4bdb..5931a92 100644\n--- a/builtin-commit-tree.c\n+++ b/builtin-commit-tree.c\n@@ -24,26 +24,20 @@ static void check_valid(unsigned char *sha1, enum object_type expect)\n \t\t    typename(expect));\n }\n \n-/*\n- * Having more than two parents is not strange at all, and this is\n- * how multi-way merges are represented.\n- */\n-#define MAXPARENT (16)\n-static unsigned char parent_sha1[MAXPARENT][20];\n-\n static const char commit_tree_usage[] = \"git-commit-tree <sha1> [-p <sha1>]* < changelog\";\n \n-static int new_parent(int idx)\n+static void new_parent(struct commit *parent, struct commit_list **parents_p)\n {\n-\tint i;\n-\tunsigned char *sha1 = parent_sha1[idx];\n-\tfor (i = 0; i < idx; i++) {\n-\t\tif (!hashcmp(parent_sha1[i], sha1)) {\n+\tunsigned char *sha1 = parent->object.sha1;\n+\tstruct commit_list *parents;\n+\tfor (parents = *parents_p; parents; parents = parents->next) {\n+\t\tif (!hashcmp(parents->item->object.sha1, sha1)) {\n \t\t\terror(\"duplicate parent %s ignored\", sha1_to_hex(sha1));\n-\t\t\treturn 0;\n+\t\t\treturn;\n \t\t}\n+\t\tparents_p = &parents->next;\n \t}\n-\treturn 1;\n+\tcommit_list_insert(parent, parents_p);\n }\n \n static const char commit_utf8_warn[] =\n@@ -54,7 +48,7 @@ static const char commit_utf8_warn[] =\n int cmd_commit_tree(int argc, const char **argv, const char *prefix)\n {\n \tint i;\n-\tint parents = 0;\n+\tstruct commit_list *parents = NULL;\n \tunsigned char tree_sha1[20];\n \tunsigned char commit_sha1[20];\n \tstruct strbuf buffer;\n@@ -69,18 +63,16 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)\n \n \tcheck_valid(tree_sha1, OBJ_TREE);\n \tfor (i = 2; i < argc; i += 2) {\n+\t\tunsigned char sha1[40];\n \t\tconst char *a, *b;\n \t\ta = argv[i]; b = argv[i+1];\n \t\tif (!b || strcmp(a, \"-p\"))\n \t\t\tusage(commit_tree_usage);\n \n-\t\tif (parents >= MAXPARENT)\n-\t\t\tdie(\"Too many parents (%d max)\", MAXPARENT);\n-\t\tif (get_sha1(b, parent_sha1[parents]))\n+\t\tif (get_sha1(b, sha1))\n \t\t\tdie(\"Not a valid object name %s\", b);\n-\t\tcheck_valid(parent_sha1[parents], OBJ_COMMIT);\n-\t\tif (new_parent(parents))\n-\t\t\tparents++;\n+\t\tcheck_valid(sha1, OBJ_COMMIT);\n+\t\tnew_parent(lookup_commit(sha1), &parents);\n \t}\n \n \t/* Not having i18n.commitencoding is the same as having utf-8 */\n@@ -94,8 +86,13 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)\n \t * different order of parents will be a _different_ changeset even\n \t * if everything else stays the same.\n \t */\n-\tfor (i = 0; i < parents; i++)\n-\t\tstrbuf_addf(&buffer, \"parent %s\\n\", sha1_to_hex(parent_sha1[i]));\n+\twhile (parents) {\n+\t\tstruct commit_list *next = parents->next;\n+\t\tstrbuf_addf(&buffer, \"parent %s\\n\",\n+\t\t\tsha1_to_hex(parents->item->object.sha1));\n+\t\tfree(parents);\n+\t\tparents = next;\n+\t}\n \n \t/* Person/date information */\n \tstrbuf_addf(&buffer, \"author %s\\n\", git_author_info(IDENT_ERROR_ON_NO_NAME));\n-- \n1.5.6.173.gde14c\n"},{"id":"81389","messageId":"4864E472.3070301@viscovery.net","threadId":"14176","inReplyTo":"alpine.DEB.1.00.0806271324010.9925@racer","subject":"Re: [PATCH] commit-tree: lift completely arbitrary limit of 16 parents","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-06-27T13:00:34Z","receivedAt":"2008-06-27T13:00:34Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> @@ -69,18 +63,16 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)\n>  \n>  \tcheck_valid(tree_sha1, OBJ_TREE);\n>  \tfor (i = 2; i < argc; i += 2) {\n> +\t\tunsigned char sha1[40];\n\n\t\tunsigned char sha1[20];\n\nis sufficient here, /me thinks.\n\n-- Hannes\n"},{"id":"81393","messageId":"alpine.DEB.1.00.0806271402110.9925@racer","threadId":"14176","inReplyTo":"4864E472.3070301@viscovery.net","subject":"Re: [PATCH] commit-tree: lift completely arbitrary limit of 16 parents","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-27T13:02:47Z","receivedAt":"2008-06-27T13:02:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 27 Jun 2008, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > @@ -69,18 +63,16 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)\n> >  \n> >  \tcheck_valid(tree_sha1, OBJ_TREE);\n> >  \tfor (i = 2; i < argc; i += 2) {\n> > +\t\tunsigned char sha1[40];\n> \n> \t\tunsigned char sha1[20];\n> \n> is sufficient here, /me thinks.\n\nOoops.  Completely correct.\n\nJunio, want me to fix it up?  Or do you want me not to bother with this \npatch at all?\n\nCiao,\nDscho\n"},{"id":"81391","messageId":"20080627130435.GM29404@genesis.frugalware.org","threadId":"14176","inReplyTo":"vpqbq1n5qv2.fsf@bauges.imag.fr","subject":"Re: octopus limit","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-27T13:04:35Z","receivedAt":"2008-06-27T13:04:35Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Fri, Jun 27, 2008 at 08:33:37AM +0200, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> There's a patch around which should remove this limitation (I think\n> it's the builtin-ification of merge).\n\nIt's in 'pu', so in case you really need it *now*, then just get git.git\nand build the 'pu' branch.\n"},{"id":"81442","messageId":"7v7icassr8.fsf@gitster.siamese.dyndns.org","threadId":"14176","inReplyTo":"alpine.DEB.1.00.0806271324010.9925@racer","subject":"Re: [PATCH] commit-tree: lift completely arbitrary limit of 16 parents","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-27T17:16:27Z","receivedAt":"2008-06-27T17:16:27Z","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> -static int new_parent(int idx)\n> +static void new_parent(struct commit *parent, struct commit_list **parents_p)\n>  {\n> -\tint i;\n> -\tunsigned char *sha1 = parent_sha1[idx];\n> -\tfor (i = 0; i < idx; i++) {\n> -\t\tif (!hashcmp(parent_sha1[i], sha1)) {\n> +\tunsigned char *sha1 = parent->object.sha1;\n> +\tstruct commit_list *parents;\n> +\tfor (parents = *parents_p; parents; parents = parents->next) {\n> +\t\tif (!hashcmp(parents->item->object.sha1, sha1)) {\n\nWouldn't it be enough to compare (parents->item == parent)?\n\n> @@ -69,18 +63,16 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)\n>  \n>  \tcheck_valid(tree_sha1, OBJ_TREE);\n>  \tfor (i = 2; i < argc; i += 2) {\n> +\t\tunsigned char sha1[40];\n\ns/4/2/;\n"},{"id":"81449","messageId":"alpine.DEB.1.00.0806271845450.9925@racer","threadId":"14176","inReplyTo":"7v7icassr8.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] commit-tree: lift completely arbitrary limit of 16 parents","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-27T17:46:43Z","receivedAt":"2008-06-27T17:46:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 27 Jun 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > -static int new_parent(int idx)\n> > +static void new_parent(struct commit *parent, struct commit_list **parents_p)\n> >  {\n> > -\tint i;\n> > -\tunsigned char *sha1 = parent_sha1[idx];\n> > -\tfor (i = 0; i < idx; i++) {\n> > -\t\tif (!hashcmp(parent_sha1[i], sha1)) {\n> > +\tunsigned char *sha1 = parent->object.sha1;\n> > +\tstruct commit_list *parents;\n> > +\tfor (parents = *parents_p; parents; parents = parents->next) {\n> > +\t\tif (!hashcmp(parents->item->object.sha1, sha1)) {\n> \n> Wouldn't it be enough to compare (parents->item == parent)?\n\nProbably, since we now use lookup_commit().  Feel free to change.\n\n> > @@ -69,18 +63,16 @@ int cmd_commit_tree(int argc, const char **argv, \n> > const char *prefix)\n> >  \n> >  \tcheck_valid(tree_sha1, OBJ_TREE);\n> >  \tfor (i = 2; i < argc; i += 2) {\n> > +\t\tunsigned char sha1[40];\n> \n> s/4/2/;\n\nYes, I admitted that already in response to Hannes.\n\nMea culpa, mea maxima culpa.\n\nSorry,\nDscho\n"}]}