{"thread":{"id":"35578","subject":"[PATCH] Remove the line length limit for graft files","startedAt":"2013-12-27T20:49:57Z","lastAt":"2013-12-28T00:50:11Z","messageCount":9,"participants":["Johannes Schindelin","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"232450","messageId":"alpine.DEB.1.00.1312272146590.1191@s15462909.onlinehome-server.info","threadId":"35578","inReplyTo":null,"subject":"[PATCH] Remove the line length limit for graft files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2013-12-27T20:49:57Z","receivedAt":"2013-12-27T20:49:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSupport for grafts predates Git's strbuf, and hence it is understandable\nthat there was a hard-coded line length limit of 1023 characters (which\nwas chosen a bit awkwardly, given that it is *exactly* one byte short of\naligning with the 41 bytes occupied by a commit name and the following\nspace or new-line character).\n\nWhile regular commit histories hardly win comprehensibility in general\nif they merge more than twenty-two branches in one go, it is not Git's\nbusiness to limit grafts in such a way.\n\nIn this particular developer's case, the use case that requires\nsubstantially longer graft lines to be supported is the visualization of\nthe commits' order implied by their changes: commits are considered to\nhave an implicit relationship iff exchanging them in an interactive\nrebase would result in merge conflicts.\n\nThusly implied branches tend to be very shallow in general, and the\nresulting thicket of implied branches is usually very wide; It is\nactually quite common that *most* of the commits in a topic branch have\nnot even one implied parent, so that a final merge commit has about as\nmany implied parents as there are commits in said branch.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin/blame.c |  8 ++++----\n commit.c        | 10 +++++-----\n 2 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 1407ae7..9047b6e 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -1804,17 +1804,17 @@ static int prepare_lines(struct scoreboard *sb)\n static int read_ancestry(const char *graft_file)\n {\n \tFILE *fp = fopen(graft_file, \"r\");\n-\tchar buf[1024];\n+\tstruct strbuf buf = STRBUF_INIT;\n \tif (!fp)\n \t\treturn -1;\n-\twhile (fgets(buf, sizeof(buf), fp)) {\n+\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n \t\t/* The format is just \"Commit Parent1 Parent2 ...\\n\" */\n-\t\tint len = strlen(buf);\n-\t\tstruct commit_graft *graft = read_graft_line(buf, len);\n+\t\tstruct commit_graft *graft = read_graft_line(buf.buf, buf.len);\n \t\tif (graft)\n \t\t\tregister_commit_graft(graft, 0);\n \t}\n \tfclose(fp);\n+\tstrbuf_release(&buf);\n \treturn 0;\n }\n \ndiff --git a/commit.c b/commit.c\nindex de16a3c..57ebea2 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -196,19 +196,19 @@ bad_graft_data:\n static int read_graft_file(const char *graft_file)\n {\n \tFILE *fp = fopen(graft_file, \"r\");\n-\tchar buf[1024];\n+\tstruct strbuf buf = STRBUF_INIT;\n \tif (!fp)\n \t\treturn -1;\n-\twhile (fgets(buf, sizeof(buf), fp)) {\n+\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n \t\t/* The format is just \"Commit Parent1 Parent2 ...\\n\" */\n-\t\tint len = strlen(buf);\n-\t\tstruct commit_graft *graft = read_graft_line(buf, len);\n+\t\tstruct commit_graft *graft = read_graft_line(buf.buf, buf.len);\n \t\tif (!graft)\n \t\t\tcontinue;\n \t\tif (register_commit_graft(graft, 1))\n-\t\t\terror(\"duplicate graft data: %s\", buf);\n+\t\t\terror(\"duplicate graft data: %s\", buf.buf);\n \t}\n \tfclose(fp);\n+\tstrbuf_release(&buf);\n \treturn 0;\n }\n \n-- \n1.8.4.msysgit.0.1109.g3c58b16\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232451","messageId":"20131227210447.GE20443@google.com","threadId":"35578","inReplyTo":"alpine.DEB.1.00.1312272146590.1191@s15462909.onlinehome-server.info","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-12-27T21:04:47Z","receivedAt":"2013-12-27T21:04:47Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n\n> While regular commit histories hardly win comprehensibility in general\n> if they merge more than twenty-two branches in one go, it is not Git's\n> business to limit grafts in such a way.\n\nFun. :)  Makes sense.\n\n[...]\n> ---\n>  builtin/blame.c |  8 ++++----\n>  commit.c        | 10 +++++-----\n>  2 files changed, 9 insertions(+), 9 deletions(-)\n\nIs this easy to reproduce so some interested but lazy person could\nwrite a test?\n\n[...]\n> --- a/builtin/blame.c\n> +++ b/builtin/blame.c\n> @@ -1804,17 +1804,17 @@ static int prepare_lines(struct scoreboard *sb)\n>  static int read_ancestry(const char *graft_file)\n>  {\n>  \tFILE *fp = fopen(graft_file, \"r\");\n> -\tchar buf[1024];\n> +\tstruct strbuf buf = STRBUF_INIT;\n>  \tif (!fp)\n>  \t\treturn -1;\n> -\twhile (fgets(buf, sizeof(buf), fp)) {\n> +\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n\nIf there is no newline at EOF, this will skip the last line, while the\nold behavior was to pay attention to it.  I haven't thought through\nwhether that's a good or bad change.  Maybe it should just be\ndocumented?\n\n[...]\n> --- a/commit.c\n> +++ b/commit.c\n> @@ -196,19 +196,19 @@ static int read_graft_file(const char *graft_file)\n[...]\n> -\twhile (fgets(buf, sizeof(buf), fp)) {\n> +\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n\nLikewise.\n\nThe rest of the patch looks good.\n\nMerry christmas,\nJonathan\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232452","messageId":"alpine.DEB.1.00.1312272208070.1191@s15462909.onlinehome-server.info","threadId":"35578","inReplyTo":"20131227210447.GE20443@google.com","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2013-12-27T21:14:22Z","receivedAt":"2013-12-27T21:14:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 27 Dec 2013, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n> \n> [...]\n> > ---\n> >  builtin/blame.c |  8 ++++----\n> >  commit.c        | 10 +++++-----\n> >  2 files changed, 9 insertions(+), 9 deletions(-)\n> \n> Is this easy to reproduce so some interested but lazy person could\n> write a test?\n\nYep. Make 25 orphan commits, add a graft line to make the first a merge of\nthe rest.\n\n> > --- a/builtin/blame.c\n> > +++ b/builtin/blame.c\n> > @@ -1804,17 +1804,17 @@ static int prepare_lines(struct scoreboard *sb)\n> >  static int read_ancestry(const char *graft_file)\n> >  {\n> >  \tFILE *fp = fopen(graft_file, \"r\");\n> > -\tchar buf[1024];\n> > +\tstruct strbuf buf = STRBUF_INIT;\n> >  \tif (!fp)\n> >  \t\treturn -1;\n> > -\twhile (fgets(buf, sizeof(buf), fp)) {\n> > +\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n> \n> If there is no newline at EOF, this will skip the last line, while the\n> old behavior was to pay attention to it.  I haven't thought through\n> whether that's a good or bad change.  Maybe it should just be\n> documented?\n\nThe way I read\n\n\tint strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)\n\t{\n\t\tint ch;\n\n\t\tif (feof(fp))\n\t\t\treturn EOF;\n\n\t\tstrbuf_reset(sb);\n\t\twhile ((ch = fgetc(fp)) != EOF) {\n\t\t\tstrbuf_grow(sb, 1);\n\t\t\tsb->buf[sb->len++] = ch;\n\t\t\tif (ch == term)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (ch == EOF && sb->len == 0)\n\t\t\treturn EOF;\n\n\t\tsb->buf[sb->len] = '\\0';\n\t\treturn 0;\n\t}\n\nit returns EOF only if ch == EOF *and* sb->len == 0, i.e. if no characters\nhave been read before hitting EOF.\n\nIn other words, strbuf_getwholeline() -- despite requiring an explicit\nterminating character argument -- does not require the last line to end\nwith that terminating character.\n\nA quick test (in my case, because I am lazy, modifying test-mergesort.c to\noutput the lines that were read by strbuf_getwholeline()) also confirms my\nsuspicion.\n\nOr maybe I missed something?\n\nCiao,\nDscho\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232453","messageId":"7vr48yj77l.fsf@alter.siamese.dyndns.org","threadId":"35578","inReplyTo":"alpine.DEB.1.00.1312272146590.1191@s15462909.onlinehome-server.info","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-27T21:48:46Z","receivedAt":"2013-12-27T21:48:46Z","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> Support for grafts predates Git's strbuf, and hence it is understandable\n> that there was a hard-coded line length limit of 1023 characters (which\n> was chosen a bit awkwardly, given that it is *exactly* one byte short of\n> aligning with the 41 bytes occupied by a commit name and the following\n> space or new-line character).\n>\n> While regular commit histories hardly win comprehensibility in general\n> if they merge more than twenty-two branches in one go, it is not Git's\n> business to limit grafts in such a way.\n>\n> In this particular developer's case, the use case that requires\n> substantially longer graft lines to be supported is the visualization of\n> the commits' order implied by their changes: commits are considered to\n> have an implicit relationship iff exchanging them in an interactive\n> rebase would result in merge conflicts.\n>\n> Thusly implied branches tend to be very shallow in general, and the\n> resulting thicket of implied branches is usually very wide; It is\n> actually quite common that *most* of the commits in a topic branch have\n> not even one implied parent, so that a final merge commit has about as\n> many implied parents as there are commits in said branch.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  builtin/blame.c |  8 ++++----\n>  commit.c        | 10 +++++-----\n>  2 files changed, 9 insertions(+), 9 deletions(-)\n\nMakes sense.  It is in line with the spirit of ef98c5cafb3e\n(commit-tree: lift completely arbitrary limit of 16 parents,\n2008-06-27), too ;-)\n\nThanks, will queue.\n\n\n> diff --git a/builtin/blame.c b/builtin/blame.c\n> index 1407ae7..9047b6e 100644\n> --- a/builtin/blame.c\n> +++ b/builtin/blame.c\n> @@ -1804,17 +1804,17 @@ static int prepare_lines(struct scoreboard *sb)\n>  static int read_ancestry(const char *graft_file)\n>  {\n>  \tFILE *fp = fopen(graft_file, \"r\");\n> -\tchar buf[1024];\n> +\tstruct strbuf buf = STRBUF_INIT;\n>  \tif (!fp)\n>  \t\treturn -1;\n> -\twhile (fgets(buf, sizeof(buf), fp)) {\n> +\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n>  \t\t/* The format is just \"Commit Parent1 Parent2 ...\\n\" */\n> -\t\tint len = strlen(buf);\n> -\t\tstruct commit_graft *graft = read_graft_line(buf, len);\n> +\t\tstruct commit_graft *graft = read_graft_line(buf.buf, buf.len);\n>  \t\tif (graft)\n>  \t\t\tregister_commit_graft(graft, 0);\n>  \t}\n>  \tfclose(fp);\n> +\tstrbuf_release(&buf);\n>  \treturn 0;\n>  }\n>  \n> diff --git a/commit.c b/commit.c\n> index de16a3c..57ebea2 100644\n> --- a/commit.c\n> +++ b/commit.c\n> @@ -196,19 +196,19 @@ bad_graft_data:\n>  static int read_graft_file(const char *graft_file)\n>  {\n>  \tFILE *fp = fopen(graft_file, \"r\");\n> -\tchar buf[1024];\n> +\tstruct strbuf buf = STRBUF_INIT;\n>  \tif (!fp)\n>  \t\treturn -1;\n> -\twhile (fgets(buf, sizeof(buf), fp)) {\n> +\twhile (!strbuf_getwholeline(&buf, fp, '\\n')) {\n>  \t\t/* The format is just \"Commit Parent1 Parent2 ...\\n\" */\n> -\t\tint len = strlen(buf);\n> -\t\tstruct commit_graft *graft = read_graft_line(buf, len);\n> +\t\tstruct commit_graft *graft = read_graft_line(buf.buf, buf.len);\n>  \t\tif (!graft)\n>  \t\t\tcontinue;\n>  \t\tif (register_commit_graft(graft, 1))\n> -\t\t\terror(\"duplicate graft data: %s\", buf);\n> +\t\t\terror(\"duplicate graft data: %s\", buf.buf);\n>  \t}\n>  \tfclose(fp);\n> +\tstrbuf_release(&buf);\n>  \treturn 0;\n>  }\n>  \n> -- \n> 1.8.4.msysgit.0.1109.g3c58b16\n>\n> -- \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232455","messageId":"20131227215919.GF20443@google.com","threadId":"35578","inReplyTo":"alpine.DEB.1.00.1312272208070.1191@s15462909.onlinehome-server.info","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-12-27T21:59:19Z","receivedAt":"2013-12-27T21:59:19Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n\n> it returns EOF only if ch == EOF *and* sb->len == 0, i.e. if no characters\n> have been read before hitting EOF.\n\nYep.  api-strbuf.txt even says so.  Sorry for the nonsense.\n\nFor what it's worth,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232459","messageId":"20131227223240.GG20443@google.com","threadId":"35578","inReplyTo":"alpine.DEB.1.00.1312272208070.1191@s15462909.onlinehome-server.info","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-12-27T22:32:40Z","receivedAt":"2013-12-27T22:32:40Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n> On Fri, 27 Dec 2013, Jonathan Nieder wrote:\n\n>> Is this easy to reproduce so some interested but lazy person could\n>> write a test?\n>\n> Yep. Make 25 orphan commits, add a graft line to make the first a merge of\n> the rest.\n\nThanks.  Here's a pair of tests doing that.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/annotate-tests.sh          | 21 +++++++++++++++++++++\n t/t6101-rev-parse-parents.sh | 16 +++++++++++++++-\n 2 files changed, 36 insertions(+), 1 deletion(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex c9d105d..304c7b7 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -116,6 +116,27 @@ test_expect_success 'blame evil merge' '\n \tcheck_count A 2 B 1 B1 2 B2 1 \"A U Thor\" 1\n '\n \n+test_expect_success 'blame huge graft' '\n+\ttest_when_finished \"git checkout branch2\" &&\n+\ttest_when_finished \"rm -f .git/info/grafts\" &&\n+\tgraft= &&\n+\tfor i in 0 1 2\n+\tdo\n+\t\tfor j in 0 1 2 3 4 5 6 7 8 9\n+\t\tdo\n+\t\t\tgit checkout --orphan \"$i$j\" &&\n+\t\t\tprintf \"%s\\n\" \"$i\" \"$j\" >file &&\n+\t\t\ttest_tick &&\n+\t\t\tGIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \\\n+\t\t\tgit commit -a -m \"$i$j\" &&\n+\t\t\tcommit=$(git rev-parse --verify HEAD) &&\n+\t\t\tgraft=\"$graft$commit \"\n+\t\tdone\n+\tdone &&\n+\tprintf \"%s \" $graft >.git/info/grafts &&\n+\tcheck_count -h 00 01 1 10 1\n+'\n+\n test_expect_success 'setup incomplete line' '\n \techo \"incomplete\" | tr -d \"\\\\012\" >>file &&\n \tGIT_AUTHOR_NAME=\"C\" GIT_AUTHOR_EMAIL=\"C@test.git\" \\\ndiff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh\nindex 7ea14ce..10b1452 100755\n--- a/t/t6101-rev-parse-parents.sh\n+++ b/t/t6101-rev-parse-parents.sh\n@@ -20,7 +20,17 @@ test_expect_success 'setup' '\n \ttest_commit start2 &&\n \tgit checkout master &&\n \tgit merge -m next start2 &&\n-\ttest_commit final\n+\ttest_commit final &&\n+\n+\ttest_seq 40 |\n+\twhile read i\n+\tdo\n+\t\tgit checkout --orphan \"b$i\" &&\n+\t\ttest_tick &&\n+\t\tgit commit --allow-empty -m \"$i\" &&\n+\t\tcommit=$(git rev-parse --verify HEAD) &&\n+\t\tprintf \"$commit \" >>.git/info/grafts\n+\tdone\n '\n \n test_expect_success 'start is valid' '\n@@ -79,6 +89,10 @@ test_expect_success 'final^1^! = final^1 ^final^1^1 ^final^1^2' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'large graft octopus' '\n+\ttest_cmp_rev_output b31 \"git rev-parse --verify b1^30\"\n+'\n+\n test_expect_success 'repack for next test' '\n \tgit repack -a -d\n '\n-- \n1.8.5.1\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232460","messageId":"alpine.DEB.1.00.1312272347460.1191@s15462909.onlinehome-server.info","threadId":"35578","inReplyTo":"20131227215919.GF20443@google.com","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2013-12-27T22:51:33Z","receivedAt":"2013-12-27T22:51:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Fri, 27 Dec 2013, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n> \n> > it returns EOF only if ch == EOF *and* sb->len == 0, i.e. if no characters\n> > have been read before hitting EOF.\n> \n> Yep.  api-strbuf.txt even says so.\n\nI never bothered to look ;-)\n\n> Sorry for the nonsense.\n\nNope, no nonsense at all. I actually had a look only after your review,\nand it definitely makes sense to double-check.\n\n> For what it's worth,\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nIt is worth a lot. Believe me, I know just how thankless a task reviewing\nis, and instead of getting praise for it, you even get abused by\ncontributors who would rather self-review their code for fear of having a\ntwist in their knockers pointed out publicly.\n\nYour review makes the code better, even if it does not result in code\nchanges all the time: it increases the confidence that the code is good.\n\nThank you, Jonathan!\nDscho\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232461","messageId":"alpine.DEB.1.00.1312272352290.1191@s15462909.onlinehome-server.info","threadId":"35578","inReplyTo":"20131227223240.GG20443@google.com","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2013-12-27T22:53:54Z","receivedAt":"2013-12-27T22:53:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Fri, 27 Dec 2013, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n> > On Fri, 27 Dec 2013, Jonathan Nieder wrote:\n> \n> >> Is this easy to reproduce so some interested but lazy person could\n> >> write a test?\n> >\n> > Yep. Make 25 orphan commits, add a graft line to make the first a merge of\n> > the rest.\n> \n> Thanks.  Here's a pair of tests doing that.\n\nThank you very much!\n\n> +\tfor i in 0 1 2\n> +\tdo\n> +\t\tfor j in 0 1 2 3 4 5 6 7 8 9\n> +\t\tdo\n\nfor the record, I usually prefer\n\n\ti=0\n\twhile test $i -t 30\n\tdo\n\t\t...\n\t\ti=$(($i+1))\n\tdone\n\nbut your code is just as good!\n\nCiao,\nDscho\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"232463","messageId":"xmqqd2khu7cs.fsf@gitster.dls.corp.google.com","threadId":"35578","inReplyTo":"20131227223240.GG20443@google.com","subject":"Re: [PATCH] Remove the line length limit for graft files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-28T00:50:11Z","receivedAt":"2013-12-28T00:50:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Johannes Schindelin wrote:\n>> On Fri, 27 Dec 2013, Jonathan Nieder wrote:\n>\n>>> Is this easy to reproduce so some interested but lazy person could\n>>> write a test?\n>>\n>> Yep. Make 25 orphan commits, add a graft line to make the first a merge of\n>> the rest.\n>\n> Thanks.  Here's a pair of tests doing that.\n>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n> ---\n>  t/annotate-tests.sh          | 21 +++++++++++++++++++++\n>  t/t6101-rev-parse-parents.sh | 16 +++++++++++++++-\n>  2 files changed, 36 insertions(+), 1 deletion(-)\n\nMakes sense.\n\nThanks, both.  Small lint-picking like this change to perfect the\nsystem, as opposed to earth-shattering new shinies, tend to often\nget neglected but are very much appreciated.\n\n> diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\n> index c9d105d..304c7b7 100644\n> --- a/t/annotate-tests.sh\n> +++ b/t/annotate-tests.sh\n> @@ -116,6 +116,27 @@ test_expect_success 'blame evil merge' '\n>  \tcheck_count A 2 B 1 B1 2 B2 1 \"A U Thor\" 1\n>  '\n>  \n> +test_expect_success 'blame huge graft' '\n> +\ttest_when_finished \"git checkout branch2\" &&\n> +\ttest_when_finished \"rm -f .git/info/grafts\" &&\n> +\tgraft= &&\n> +\tfor i in 0 1 2\n> +\tdo\n> +\t\tfor j in 0 1 2 3 4 5 6 7 8 9\n> +\t\tdo\n> +\t\t\tgit checkout --orphan \"$i$j\" &&\n> +\t\t\tprintf \"%s\\n\" \"$i\" \"$j\" >file &&\n> +\t\t\ttest_tick &&\n> +\t\t\tGIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \\\n> +\t\t\tgit commit -a -m \"$i$j\" &&\n> +\t\t\tcommit=$(git rev-parse --verify HEAD) &&\n> +\t\t\tgraft=\"$graft$commit \"\n> +\t\tdone\n> +\tdone &&\n> +\tprintf \"%s \" $graft >.git/info/grafts &&\n> +\tcheck_count -h 00 01 1 10 1\n> +'\n> +\n>  test_expect_success 'setup incomplete line' '\n>  \techo \"incomplete\" | tr -d \"\\\\012\" >>file &&\n>  \tGIT_AUTHOR_NAME=\"C\" GIT_AUTHOR_EMAIL=\"C@test.git\" \\\n> diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh\n> index 7ea14ce..10b1452 100755\n> --- a/t/t6101-rev-parse-parents.sh\n> +++ b/t/t6101-rev-parse-parents.sh\n> @@ -20,7 +20,17 @@ test_expect_success 'setup' '\n>  \ttest_commit start2 &&\n>  \tgit checkout master &&\n>  \tgit merge -m next start2 &&\n> -\ttest_commit final\n> +\ttest_commit final &&\n> +\n> +\ttest_seq 40 |\n> +\twhile read i\n> +\tdo\n> +\t\tgit checkout --orphan \"b$i\" &&\n> +\t\ttest_tick &&\n> +\t\tgit commit --allow-empty -m \"$i\" &&\n> +\t\tcommit=$(git rev-parse --verify HEAD) &&\n> +\t\tprintf \"$commit \" >>.git/info/grafts\n> +\tdone\n>  '\n>  \n>  test_expect_success 'start is valid' '\n> @@ -79,6 +89,10 @@ test_expect_success 'final^1^! = final^1 ^final^1^1 ^final^1^2' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> +test_expect_success 'large graft octopus' '\n> +\ttest_cmp_rev_output b31 \"git rev-parse --verify b1^30\"\n> +'\n> +\n>  test_expect_success 'repack for next test' '\n>  \tgit repack -a -d\n>  '\n> -- \n> 1.8.5.1\n>\n> -- \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"}]}