> On July 7, 2015, 9:32 p.m., Marco Massenzio wrote:
> > support/post-reviews.py, line 173
> > <https://reviews.apache.org/r/35777/diff/2/?file=1001308#file1001308line173>
> >
> >     note that here you will be printing the whole commit message, which in 
> > this case is not appropriate.
> >     
> >     I would do instead:
> >     ```
> >     pos = message.find('Review:')
> >     if pos != -1:
> >         ...
> >         print ...format(message[pos:])
> >     ```
> >     should make the error message clearer.

ok - to be a bit more pedantic:
```
if pos != -1:
    ...
    if not match:
        newline = max(message.find('\n', pos), len(message))
        print ...format(message[pos:newline])
```


- Marco


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35777/#review90783
-----------------------------------------------------------


On July 7, 2015, 3:19 p.m., Michael Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35777/
> -----------------------------------------------------------
> 
> (Updated July 7, 2015, 3:19 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Marco Massenzio, and Till 
> Toenshoff.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> (1) Handles the case where the `Review: ...` line isn't the last of the 
> commit message.
> 
> ```
> 01596ce802669e9dac7dd24193f041cef3354830 - Fixed post-reviews.py hanging bug. 
> (6 seconds ago)
> 
> ReviewBoard URL must be the last line of the commit message!
> 
> Fixed post-reviews.py hanging bug.
> 
> Review: https://reviews.apache.org/r/35771
> 
> abcd
> ```
> 
> (2) Handles the case where the ReviewBoard URL is invalid.
> 
> ```
> af081a07234794f60a2575e0383ce537d7111c18 - Fixed post-reviews.py hanging bug. 
> (29 seconds ago)
> 
> Invalid ReviewBoard URL : 'https://reviews.apache.org/r/35771 abcd'
> ```
> 
> 
> Diffs
> -----
> 
>   support/post-reviews.py b04e26b85e6b056098c15078f9b31dc352682351 
> 
> Diff: https://reviews.apache.org/r/35777/diff/
> 
> 
> Testing
> -------
> 
> Modified the commit message with `git rebase` and ran 
> `./support/post-reviews.py` to observe the above error messages.
> Used the valid commit message for this patch and created it by running 
> `./support/post-reviews.py`.
> 
> 
> Thanks,
> 
> Michael Park
> 
>

Reply via email to