[PATCH aiaiai 6/7] aiaiai: extract patches from email prior to using git-am

Keller, Jacob E jacob.e.keller at intel.com
Mon Apr 7 14:17:44 PDT 2014


On Mon, 2014-04-07 at 13:19 +0300, Artem Bityutskiy wrote:
> On Fri, 2014-04-04 at 15:06 -0700, Jacob Keller wrote:
> > Some patch authors submit patches directly attached via git-format-patch
> > output as an attachment. Sometimes they include both the patch and the
> > inline diff. This is problematic because it causes aiaiai to fail to
> > apply the patch, due to git being confused about the attached patch.
> > This patch modifies how aiaiai reads the commits, using a python script
> > which is capable of extracting the patches from the mbox (including
> > attachments) before calling git-am.
> > 
> > This helps aiaiai more easily handle this weird patch case, and still
> > works great for regular patch submissions. In addition, turn on 3-way
> > merge of git-am, so that duplicate patches will be properly ignored (as
> > in the case with inlined and attached patches)
> > 
> > Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> > ---
> >  helpers/aiaiai-extract-patches | 54 ++++++++++++++++++++++++++++++++++++++++++
> >  helpers/aiaiai-sh-functions    |  2 +-
> >  2 files changed, 55 insertions(+), 1 deletion(-)
> >  create mode 100755 helpers/aiaiai-extract-patches
> 
> Would you mind to clean-up the style a little. Try checking with pylint:
> 
> pylint --report=no aiaiai-extract-patches

Sure. I'm not sure what about my style is wrong, but..

> 
> > +++ b/helpers/aiaiai-extract-patches
> > @@ -0,0 +1,54 @@
> > +#!/usr/bin/python2
> 
> Would you please this shebang instead:
> 
> #!/usr/bin/env python
> 

#!/usr/bin/env python2

You have to specify python2 incase someone's default is python3, as this
script is probably not compatible with python3.

> This is used in 'helpers/aiaiai-diff-log-helper', let's be consistent. 
> 
> Also, the proper pythonic way to structure runnable scripts is like
> this, for historical reasons:
> 
> =====================================================
> def main(argv):
>     """Script entry point."""
> 
>     ... all your stuff goes here ...
> 
> if __name__ == "__main__":
>     sys.exit(main(sys.argv))
> =====================================================
> 
> Would you please re-strucutre? Check 'helpers/aiaiai-diff-log-helper'.
> 

Sure, I can do that I suppose :)

Regards,
Jake

> Thanks!
> 




More information about the aiaiai mailing list