> On Nov. 10, 2015, 4:11 a.m., Kapil Arya wrote: > > support/apply-reviews.py, lines 196-197 > > <https://reviews.apache.org/r/39410/diff/13/?file=1119828#file1119828line196> > > > > Can we enhance it as following: > > ``` > > amend=options['no_amend'] ? '' : '-e' > > cmd = 'git commit --author \'{author}\' {amend} -am \'{message}\''\ > > .format(author=quote(data['author']), > > amend=amend, > > message=quote(data['message'])) > > ``` > > > > With this, we can now get rid of `amend_patch()`. This will speed up > > the process since we don't have to call `git commit --amend`. As we know, a > > call to `git commit --amend` without any staged file forces a full run of > > mesos-style.py, which can take several seconds. > > Artem Harutyunyan wrote: > TIL Python does not have a ternary operator, but point taken :).
Well, it has something that gets close enough :) ``` amend = '-e' if not options.get('no_amend') else '' ``` which I actually find more readable than the `? :` operator (and, apparently, Guido does too ;) ) - Marco ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39410/#review105786 ----------------------------------------------------------- On Nov. 11, 2015, 10:10 a.m., Artem Harutyunyan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39410/ > ----------------------------------------------------------- > > (Updated Nov. 11, 2015, 10:10 a.m.) > > > Review request for mesos, Adam B, Joris Van Remoortere, Joseph Wu, Marco > Massenzio, and Vinod Kone. > > > Bugs: MESOS-3859 > https://issues.apache.org/jira/browse/MESOS-3859 > > > Repository: mesos > > > Description > ------- > > Added support for github to apply-reviews.py. > > > Diffs > ----- > > support/apply-reviews.py d39ee9bb0ee782bd756b7a5fc0dec70d056c9589 > > Diff: https://reviews.apache.org/r/39410/diff/ > > > Testing > ------- > > Tested with python 2.7 > > > Thanks, > > Artem Harutyunyan > >