mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Klues <klue...@gmail.com>
Subject Re: Review Request 45768: Fixed commit message hook to skip over the commented lines.
Date Tue, 05 Apr 2016 20:01:31 GMT

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




support/hooks/commit-msg (line 20)
<https://reviews.apache.org/r/45768/#comment190371>

    You should probably quote the $LINE variable here. You should also use a single "=", not
"==". The double equals will not work on all versions of sh (most notably on mac os).
    I would also just check the first character to equal "#" instead of comaping the whole
line.
    
    Also, when you hit a line with a comment, you probably shouldn't break. Instead you should
continue (in case there is more text to include in the commit message later on).
    
    The new loop would look like:
    
    ```
    while read LINE
    do
        if [[ "${LINE:0:1}" == "#" ]]; then continue; fi
        LENGTH=$(echo $LINE | wc -c)
        if [ "$LENGTH" -gt "73" ]; then
            echo >&2 "Error: No line in the commit message summary may exceed 72 characters."
            exit 1
        fi
    ```


- Kevin Klues


On April 5, 2016, 7:50 p.m., Michael Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45768/
> -----------------------------------------------------------
> 
> (Updated April 5, 2016, 7:50 p.m.)
> 
> 
> Review request for mesos, Joerg Schad and Vinod Kone.
> 
> 
> Bugs: MESOS-5126
>     https://issues.apache.org/jira/browse/MESOS-5126
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg d3d5415bf6a243def05cf79f4af2b136b9866d68 
> 
> Diff: https://reviews.apache.org/r/45768/diff/
> 
> 
> Testing
> -------
> 
> Was able to commit a patch where there were lines longer than 72 characters in the commented
section.
> 
> 
> Thanks,
> 
> Michael Park
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message