Closed Bug 829389 Opened 11 years ago Closed 11 years ago

bzexport should strip reviewers from *first line* of multiline commit messages

Categories

(Developer Services :: Mercurial: bzexport, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file, 1 obsolete file)

In Mercurial (as with other major version control systems), the semantics of the first line of the commit message are different from later lines.  The first line is the "short" part of the commit mesage, and the rest is the more detailed description.

reviewers go on the first line of the message, not in the detailed description, as in commits like this: https://hg.mozilla.org/mozilla-central/rev/830111e10951

bzexport's code for multiline commit messages and its code for removing reviews are currently backwards.  (I've had this fixed locally for ages; I just never bothered to post the patch anywhere.)
Attached patch patchSplinter Review
Guessing sfink as an appropriate reviewer.

I'm actually not sure the behavior without this change is as bad as it was when I wrote it (against 83f819df84d7 or earlier), but I still think it's the right thing to do.
Attachment #700790 - Flags: review?(sphink)
Comment on attachment 700790 [details] [diff] [review]
patch

Review of attachment 700790 [details] [diff] [review]:
-----------------------------------------------------------------

::: __init__.py
@@ +719,5 @@
>          desc = desc.lstrip()
>          if desc[0] in ['-', ':', '.']:
>              desc = desc[1:].lstrip()
>  
> +        # Next, just take the first line in case. If there is more than one

Bleh, I've kind of made a mess here.

bzexport explicitly only looks for bug numbers in the first line, by splitting the first line from the rest and only matching against the former. But when I did that, I left in the logic to split it apart again, later.

So really, the code should be cleaned up to split once, at the beginning, and look for both bugs and reviewers in parts[0].

Your fix is totally valid, so land it if you'd like since it's an improvement.

The unintelligible comment ("take the first line in case.") should also be fixed, but that can come with the cleanup too.

It should help that I've somewhat learned Python since writing all this code... :-)
Attachment #700790 - Flags: review?(sphink) → review+
Each time I think of landing this, I realize there's some change I need to rebase it against and feel like I ought to test it for a little bit before inflicting it on the rest of the world.  This time I'll at least note a reminder...
I'm generally pretty lax about bzexport changes. If it fixes an issue for you then feel free to push it.
Assignee: nobody → dbaron
Ah amazing, this has been bugging me for a while! :-)
Assignee: dbaron → jgriffin
Comment on attachment 799817 [details] [diff] [review]
Strip reviewers from *first line* of multiline commit messages.

Whoops, testing out a new install of bzexport and uploaded this by accident.
Attachment #799817 - Attachment is obsolete: true
Assignee: jgriffin → dbaron
Product: Other Applications → Developer Services
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: