{"thread":{"id":"13658","subject":"[PATCH] builtin-fast-export: Only output a single parent per line","startedAt":"2008-05-24T23:21:53Z","lastAt":"2008-05-26T05:30:21Z","messageCount":6,"participants":["Pieter de Bie","Junio C Hamano","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77682","messageId":"1211671313-99006-1-git-send-email-pdebie@ai.rug.nl","threadId":"13658","inReplyTo":null,"subject":"[PATCH] builtin-fast-export: Only output a single parent per line","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-05-24T23:21:53Z","receivedAt":"2008-05-24T23:21:53Z","isPatch":true,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"According to the git-fast-import man-page, you can only put a single\ncommittish per merge: line, like this:\n\n  merge :10\n  merge :11\n\nHowever, git-fast-export puts all parents on a single line, like this:\n\n  merge :10 :11\n\nThis may be fine with git-fast-import, but other importers based on it, like\nbzr-fast-import, can't handle this.\n\nThis changes fast-export to also output a single parent per line.\n\nSigned-off-by: Pieter de Bie <pdebie@ai.rug.nl>\n---\n\nI'm not sure why this was done, but it messed up my import :)\n builtin-fast-export.c |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex e1c5630..34acdf9 100755\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -204,10 +204,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)\n \t\t\tcontinue;\n \t\tif (i == 0)\n \t\t\tprintf(\"from :%d\\n\", mark);\n-\t\telse if (i == 1)\n-\t\t\tprintf(\"merge :%d\", mark);\n \t\telse\n-\t\t\tprintf(\" :%d\", mark);\n+\t\t\tprintf(\"merge :%d\\n\", mark);\n \t\ti++;\n \t}\n \tif (i > 1)\n-- \n1.5.5.1.541.g51dc4.dirty\n"},{"id":"77689","messageId":"7vskw7jh7c.fsf@gitster.siamese.dyndns.org","threadId":"13658","inReplyTo":"1211671313-99006-1-git-send-email-pdebie@ai.rug.nl","subject":"Re: [PATCH] builtin-fast-export: Only output a single parent per line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-25T01:38:47Z","receivedAt":"2008-05-25T01:38:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pieter de Bie <pdebie@ai.rug.nl> writes:\n\n> According to the git-fast-import man-page, you can only put a single\n> committish per merge: line, like this:\n>\n>   merge :10\n>   merge :11\n>\n> However, git-fast-export puts all parents on a single line, like this:\n>\n>   merge :10 :11\n>\n> This may be fine with git-fast-import,...\n\nIs it fine for even git-fast-import?  fast-import.c: parse_merge() seems\nto suggest that it also wants one parent per \"merge \" line.\n"},{"id":"77730","messageId":"20080526014904.GZ29038@spearce.org","threadId":"13658","inReplyTo":"7vskw7jh7c.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] builtin-fast-export: Only output a single parent per line","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-05-26T01:49:05Z","receivedAt":"2008-05-26T01:49:05Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Pieter de Bie <pdebie@ai.rug.nl> writes:\n> \n> > According to the git-fast-import man-page, you can only put a single\n> > committish per merge: line, like this:\n> >\n> >   merge :10\n> >   merge :11\n> >\n> > However, git-fast-export puts all parents on a single line, like this:\n> >\n> >   merge :10 :11\n> >\n> > This may be fine with git-fast-import,...\n> \n> Is it fine for even git-fast-import?  fast-import.c: parse_merge() seems\n> to suggest that it also wants one parent per \"merge \" line.\n\nfast-import wants the same as bzr-fast-import; one parent per\nmerge line.  If git-fast-import was doing anything with multiple\nper line it was probably dropping everything after the first.  :-(\n\nThis was a bug in fast-export; I'm glad Pieter has fixed it.\n\n-- \nShawn.\n"},{"id":"77743","messageId":"7v7idhej6f.fsf@gitster.siamese.dyndns.org","threadId":"13658","inReplyTo":"20080526014904.GZ29038@spearce.org","subject":"Re: [PATCH] builtin-fast-export: Only output a single parent per line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-26T05:19:36Z","receivedAt":"2008-05-26T05:19:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> wrote:\n> ...\n>> Is it fine for even git-fast-import?  fast-import.c: parse_merge() seems\n>> to suggest that it also wants one parent per \"merge \" line.\n>\n> fast-import wants the same as bzr-fast-import; one parent per\n> merge line.  If git-fast-import was doing anything with multiple\n> per line it was probably dropping everything after the first.  :-(\n>\n> This was a bug in fast-export; I'm glad Pieter has fixed it.\n\nUnfortunately, t9301 does not pass with the \"fix\".\n"},{"id":"77744","messageId":"7vzlqdd4ef.fsf@gitster.siamese.dyndns.org","threadId":"13658","inReplyTo":"7v7idhej6f.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] builtin-fast-export: Only output a single parent per line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-26T05:24:08Z","receivedAt":"2008-05-26T05:24:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n>\n>> Junio C Hamano <gitster@pobox.com> wrote:\n>> ...\n>>> Is it fine for even git-fast-import?  fast-import.c: parse_merge() seems\n>>> to suggest that it also wants one parent per \"merge \" line.\n>>\n>> fast-import wants the same as bzr-fast-import; one parent per\n>> merge line.  If git-fast-import was doing anything with multiple\n>> per line it was probably dropping everything after the first.  :-(\n>>\n>> This was a bug in fast-export; I'm glad Pieter has fixed it.\n>\n> Unfortunately, t9301 does not pass with the \"fix\".\n\nPerhaps, this is needed on top?\n\n builtin-fast-export.c |    2 --\n 1 files changed, 0 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex 4d28cf7..4bf5b58 100755\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -209,8 +209,6 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)\n \t\t\tprintf(\"merge :%d\\n\", mark);\n \t\ti++;\n \t}\n-\tif (i > 1)\n-\t\tprintf(\"\\n\");\n \n \tlog_tree_diff_flush(rev);\n \trev->diffopt.output_format = saved_output_format;\n"},{"id":"77745","messageId":"20080526053020.GD30245@spearce.org","threadId":"13658","inReplyTo":"7vzlqdd4ef.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] builtin-fast-export: Only output a single parent per line","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-05-26T05:30:21Z","receivedAt":"2008-05-26T05:30:21Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> > Unfortunately, t9301 does not pass with the \"fix\".\n> \n> Perhaps, this is needed on top?\n> \n>  builtin-fast-export.c |    2 --\n>  1 files changed, 0 insertions(+), 2 deletions(-)\n> \n> diff --git a/builtin-fast-export.c b/builtin-fast-export.c\n> index 4d28cf7..4bf5b58 100755\n> --- a/builtin-fast-export.c\n> +++ b/builtin-fast-export.c\n> @@ -209,8 +209,6 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)\n>  \t\t\tprintf(\"merge :%d\\n\", mark);\n>  \t\ti++;\n>  \t}\n> -\tif (i > 1)\n> -\t\tprintf(\"\\n\");\n>  \n>  \tlog_tree_diff_flush(rev);\n>  \trev->diffopt.output_format = saved_output_format;\n\n\nYea, that looks right.  The LF shouldn't follow the last merge\ncommand.\n\n-- \nShawn.\n"}]}