git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
@ 2011-02-26  2:31 Michael Horowitz
  2011-02-26  7:37 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Horowitz @ 2011-02-26  2:31 UTC (permalink / raw)
  To: git, gitster

In an attempt to overwrite the 'Description:' section of the p4 change
log to include the git commit messages, it also overwrote the 'Jobs:'
section.  This fix restores the 'Job:' section.

Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org>
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index a92beb6..8b00fd8 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -570,7 +570,7 @@ class P4Submit(Command):
                continue

            if inDescriptionSection:
-                if line.startswith("Files:"):
+                if line.startswith("Files:") or line.startswith("Jobs:"):
                    inDescriptionSection = False
                else:
                    continue
--
1.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
  2011-02-26  2:31 [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log Michael Horowitz
@ 2011-02-26  7:37 ` Junio C Hamano
  2011-02-26 16:20   ` Michael Horowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2011-02-26  7:37 UTC (permalink / raw)
  To: Michael Horowitz; +Cc: git

Michael Horowitz <michael.horowitz@ieee.org> writes:

> In an attempt to overwrite the 'Description:' section of the p4 change
> log to include the git commit messages, it also overwrote the 'Jobs:'
> section.  This fix restores the 'Job:' section.
>
> Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org>
> ---
>  contrib/fast-import/git-p4 |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index a92beb6..8b00fd8 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -570,7 +570,7 @@ class P4Submit(Command):
>                 continue
>
>             if inDescriptionSection:
> -                if line.startswith("Files:"):
> +                if line.startswith("Files:") or line.startswith("Jobs:"):
>                     inDescriptionSection = False
>                 else:
>                     continue

This is not a new issue with the code, but it makes me wonder if the
output you are reading from guaranteed to have these lines in the same
order.  Otherwise the next bug report and/or patch would add another
similar looking line.startswith("SomethingElse:") to this statement, and
we wouldn't know when to stop, would we?

Will queue anyway, though.  Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
  2011-02-26  7:37 ` Junio C Hamano
@ 2011-02-26 16:20   ` Michael Horowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Horowitz @ 2011-02-26 16:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Sat, Feb 26, 2011 at 2:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Michael Horowitz <michael.horowitz@ieee.org> writes:
>
>> In an attempt to overwrite the 'Description:' section of the p4 change
>> log to include the git commit messages, it also overwrote the 'Jobs:'
>> section.  This fix restores the 'Job:' section.
>>
>> Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org>
>> ---
>>  contrib/fast-import/git-p4 |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
>> index a92beb6..8b00fd8 100755
>> --- a/contrib/fast-import/git-p4
>> +++ b/contrib/fast-import/git-p4
>> @@ -570,7 +570,7 @@ class P4Submit(Command):
>>                 continue
>>
>>             if inDescriptionSection:
>> -                if line.startswith("Files:"):
>> +                if line.startswith("Files:") or line.startswith("Jobs:"):
>>                     inDescriptionSection = False
>>                 else:
>>                     continue
>
> This is not a new issue with the code, but it makes me wonder if the
> output you are reading from guaranteed to have these lines in the same
> order.  Otherwise the next bug report and/or patch would add another
> similar looking line.startswith("SomethingElse:") to this statement, and
> we wouldn't know when to stop, would we?
>
> Will queue anyway, though.  Thanks.
>
>

Yes, you are correct, it could be written in a more robust way.
Ideally, with a proper spec, the parser can be written to handle all
the cases.  Unfortunately, I am not familiar enough to do much more
than fix the immediate issue I am having.  I only know enough Python
to make this simple change, and it seems to work in my tests.

Thanks,

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-26 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-26  2:31 [PATCH] git-p4 submit: prevent 'Jobs' section from being removed from p4 change log Michael Horowitz
2011-02-26  7:37 ` Junio C Hamano
2011-02-26 16:20   ` Michael Horowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).