> On April 5, 2016, 8:01 p.m., Kevin Klues wrote:
> > support/hooks/commit-msg, line 20
> > <https://reviews.apache.org/r/45768/diff/1/?file=1326651#file1326651line20>
> >
> >     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
> >     ```

Whoops, I meant the following (this actually has the single "=" and uses single 
"[" "]"'s around the if instead of "[[", which is also non-portable.

```
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
done
```


- Kevin


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


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
> 
>

Reply via email to