{"thread":{"id":"26605","subject":"[PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log","startedAt":"2011-02-26T02:31:13Z","lastAt":"2011-02-26T16:20:10Z","messageCount":3,"participants":["Michael Horowitz","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"162281","messageId":"AANLkTimdd_AdVyDGKyLUoOABuRjJ5QmpC3DnMQYRRcNm@mail.gmail.com","threadId":"26605","inReplyTo":null,"subject":"[PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-02-26T02:31:13Z","receivedAt":"2011-02-26T02:31:13Z","isPatch":true,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"In an attempt to overwrite the 'Description:' section of the p4 change\nlog to include the git commit messages, it also overwrote the 'Jobs:'\nsection.  This fix restores the 'Job:' section.\n\nSigned-off-by: Michael Horowitz <michael.horowitz@ieee.org>\n---\n contrib/fast-import/git-p4 |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex a92beb6..8b00fd8 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -570,7 +570,7 @@ class P4Submit(Command):\n                continue\n\n            if inDescriptionSection:\n-                if line.startswith(\"Files:\"):\n+                if line.startswith(\"Files:\") or line.startswith(\"Jobs:\"):\n                    inDescriptionSection = False\n                else:\n                    continue\n--\n1.7.4\n"},{"id":"162292","messageId":"7vk4gn8cwm.fsf@alter.siamese.dyndns.org","threadId":"26605","inReplyTo":"AANLkTimdd_AdVyDGKyLUoOABuRjJ5QmpC3DnMQYRRcNm@mail.gmail.com","subject":"Re: [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-26T07:37:13Z","receivedAt":"2011-02-26T07:37:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Horowitz <michael.horowitz@ieee.org> writes:\n\n> In an attempt to overwrite the 'Description:' section of the p4 change\n> log to include the git commit messages, it also overwrote the 'Jobs:'\n> section.  This fix restores the 'Job:' section.\n>\n> Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org>\n> ---\n>  contrib/fast-import/git-p4 |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\n> index a92beb6..8b00fd8 100755\n> --- a/contrib/fast-import/git-p4\n> +++ b/contrib/fast-import/git-p4\n> @@ -570,7 +570,7 @@ class P4Submit(Command):\n>                 continue\n>\n>             if inDescriptionSection:\n> -                if line.startswith(\"Files:\"):\n> +                if line.startswith(\"Files:\") or line.startswith(\"Jobs:\"):\n>                     inDescriptionSection = False\n>                 else:\n>                     continue\n\nThis is not a new issue with the code, but it makes me wonder if the\noutput you are reading from guaranteed to have these lines in the same\norder.  Otherwise the next bug report and/or patch would add another\nsimilar looking line.startswith(\"SomethingElse:\") to this statement, and\nwe wouldn't know when to stop, would we?\n\nWill queue anyway, though.  Thanks.\n"},{"id":"162315","messageId":"AANLkTimuOn0AD8nB1kXBA60y9bgmB1FfciJSbBJeAQd-@mail.gmail.com","threadId":"26605","inReplyTo":"7vk4gn8cwm.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-02-26T16:20:10Z","receivedAt":"2011-02-26T16:20:10Z","isPatch":true,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"On Sat, Feb 26, 2011 at 2:37 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Michael Horowitz <michael.horowitz@ieee.org> writes:\n>\n>> In an attempt to overwrite the 'Description:' section of the p4 change\n>> log to include the git commit messages, it also overwrote the 'Jobs:'\n>> section.  This fix restores the 'Job:' section.\n>>\n>> Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org>\n>> ---\n>>  contrib/fast-import/git-p4 |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\n>> index a92beb6..8b00fd8 100755\n>> --- a/contrib/fast-import/git-p4\n>> +++ b/contrib/fast-import/git-p4\n>> @@ -570,7 +570,7 @@ class P4Submit(Command):\n>>                 continue\n>>\n>>             if inDescriptionSection:\n>> -                if line.startswith(\"Files:\"):\n>> +                if line.startswith(\"Files:\") or line.startswith(\"Jobs:\"):\n>>                     inDescriptionSection = False\n>>                 else:\n>>                     continue\n>\n> This is not a new issue with the code, but it makes me wonder if the\n> output you are reading from guaranteed to have these lines in the same\n> order.  Otherwise the next bug report and/or patch would add another\n> similar looking line.startswith(\"SomethingElse:\") to this statement, and\n> we wouldn't know when to stop, would we?\n>\n> Will queue anyway, though.  Thanks.\n>\n>\n\nYes, you are correct, it could be written in a more robust way.\nIdeally, with a proper spec, the parser can be written to handle all\nthe cases.  Unfortunately, I am not familiar enough to do much more\nthan fix the immediate issue I am having.  I only know enough Python\nto make this simple change, and it seems to work in my tests.\n\nThanks,\n\nMike\n"}]}