You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Andrew Schwartzmeyer <an...@schwartzmeyer.com> on 2017/06/19 23:18:35 UTC

Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

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

Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.


Bugs: MESOS-4331
    https://issues.apache.org/jira/browse/MESOS-4331


Repository: mesos


Description
-------

The capitalization check caused rebases to fail for commits made with
`--fixup` and `--squash`. This change ignores the check for these cases.


Diffs
-----

  support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 


Diff: https://reviews.apache.org/r/60216/diff/1/


Testing
-------


Thanks,

Andrew Schwartzmeyer


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.

> On June 27, 2017, 7:52 p.m., Benjamin Bannier wrote:
> > support/hooks/commit-msg
> > Lines 18 (patched)
> > <https://reviews.apache.org/r/60216/diff/2/?file=1764349#file1764349line18>
> >
> >     Could you make sure we only match at the beginning of the string, something like
> >     
> >        if [[ "$FIRST_LINE" =~ ^(fixup|squash)! ]]; then
> >        
> >     Note that I added some escaping here to deal with history expansion, could you please confirm that this is reasonable?
> 
> Benjamin Bannier wrote:
>     Well, reviewboard swallowed my escaping,
>     
>         if [[ "$FIRST_LINE" =~ ^(fixup|squash)! ]]; then

Verified that we definitely want the `^`, and that `!` doesn't break it. I don't _think_ that Bash is going to expand history in the regular expansion, but user `!` is safer.


- Andrew


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


On June 27, 2017, 7:41 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 27, 2017, 7:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Benjamin Bannier <be...@mesosphere.io>.

> On June 27, 2017, 9:52 p.m., Benjamin Bannier wrote:
> > support/hooks/commit-msg
> > Lines 18 (patched)
> > <https://reviews.apache.org/r/60216/diff/2/?file=1764349#file1764349line18>
> >
> >     Could you make sure we only match at the beginning of the string, something like
> >     
> >        if [[ "$FIRST_LINE" =~ ^(fixup|squash)! ]]; then
> >        
> >     Note that I added some escaping here to deal with history expansion, could you please confirm that this is reasonable?

Well, reviewboard swallowed my escaping,

    if [[ "$FIRST_LINE" =~ ^(fixup|squash)! ]]; then


- Benjamin


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


On June 27, 2017, 9:41 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 27, 2017, 9:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60216/#review179028
-----------------------------------------------------------



Great idea, AFAICT this does what we want and is much simpler.


support/hooks/commit-msg
Lines 18 (patched)
<https://reviews.apache.org/r/60216/#comment253429>

    Could you make sure we only match at the beginning of the string, something like
    
       if [[ "$FIRST_LINE" =~ ^(fixup|squash)! ]]; then
       
    Note that I added some escaping here to deal with history expansion, could you please confirm that this is reasonable?


- Benjamin Bannier


On June 27, 2017, 9:41 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 27, 2017, 9:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60216/#review179032
-----------------------------------------------------------


Ship it!




Ship It!

- Benjamin Bannier


On June 27, 2017, 10:07 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 27, 2017, 10:07 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Alexander Rukletsov <ru...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60216/#review179082
-----------------------------------------------------------


Ship it!




Ship It!

- Alexander Rukletsov


On June 27, 2017, 8:07 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 27, 2017, 8:07 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60216/
-----------------------------------------------------------

(Updated June 27, 2017, 8:07 p.m.)


Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.


Bugs: MESOS-4331
    https://issues.apache.org/jira/browse/MESOS-4331


Repository: mesos


Description
-------

The capitalization check caused rebases to fail for commits made with
`--fixup` and `--squash`. This change ignores the check for these cases.


Diffs (updated)
-----

  support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 


Diff: https://reviews.apache.org/r/60216/diff/3/

Changes: https://reviews.apache.org/r/60216/diff/2-3/


Testing
-------


Thanks,

Andrew Schwartzmeyer


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60216/
-----------------------------------------------------------

(Updated June 27, 2017, 7:41 p.m.)


Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.


Bugs: MESOS-4331
    https://issues.apache.org/jira/browse/MESOS-4331


Repository: mesos


Description
-------

The capitalization check caused rebases to fail for commits made with
`--fixup` and `--squash`. This change ignores the check for these cases.


Diffs (updated)
-----

  support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 


Diff: https://reviews.apache.org/r/60216/diff/2/

Changes: https://reviews.apache.org/r/60216/diff/1-2/


Testing
-------


Thanks,

Andrew Schwartzmeyer


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.

> On June 20, 2017, 8:35 a.m., Benjamin Bannier wrote:
> > I think this does not work as is since we would e.g., still reject commits where the commit summary is longer than 72 chars, e.g., the following commit summary should be considered formally okay,
> > 
> >     fixup fixup squash AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.
> >     
> > One way to achieve that would be to e.g., treat the length check of the summary line separately from the description, but maybe you have a better idea.

Oh, good catch. I'll ponder it.


- Andrew


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


On June 19, 2017, 11:18 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 19, 2017, 11:18 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.

> On June 20, 2017, 8:35 a.m., Benjamin Bannier wrote:
> > I think this does not work as is since we would e.g., still reject commits where the commit summary is longer than 72 chars, e.g., the following commit summary should be considered formally okay,
> > 
> >     fixup fixup squash AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.
> >     
> > One way to achieve that would be to e.g., treat the length check of the summary line separately from the description, but maybe you have a better idea.
> 
> Andrew Schwartzmeyer wrote:
>     Oh, good catch. I'll ponder it.

So I ended up making this much simpler: if it starts with `fixup!` or `squash!` we exit the script. It is pointless to check the commit if it's a fixup or squash commit, since the actual commit that gets fixed up or squashed will be checked.


- Andrew


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


On June 27, 2017, 7:41 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 27, 2017, 7:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 60216: Fixed the commit message hook to allow `fixup` and `squash` commits.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60216/#review178357
-----------------------------------------------------------



I think this does not work as is since we would e.g., still reject commits where the commit summary is longer than 72 chars, e.g., the following commit summary should be considered formally okay,

    fixup fixup squash AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.
    
One way to achieve that would be to e.g., treat the length check of the summary line separately from the description, but maybe you have a better idea.

- Benjamin Bannier


On June 20, 2017, 1:18 a.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60216/
> -----------------------------------------------------------
> 
> (Updated June 20, 2017, 1:18 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Joseph Wu, and Michael Park.
> 
> 
> Bugs: MESOS-4331
>     https://issues.apache.org/jira/browse/MESOS-4331
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The capitalization check caused rebases to fail for commits made with
> `--fixup` and `--squash`. This change ignores the check for these cases.
> 
> 
> Diffs
> -----
> 
>   support/hooks/commit-msg 755309e70581835d01f53c1910b37b6cd3ea98ca 
> 
> 
> Diff: https://reviews.apache.org/r/60216/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>