git-cl-upload: write commit description to file

Bug: 780540
Change-Id: I85bf40d8faa482786589f9031e34f364342c06dd
Reviewed-on: https://chromium-review.googlesource.com/754003
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 2047775..1c3323b 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -27,6 +27,7 @@
 import shutil
 import stat
 import sys
+import tempfile
 import textwrap
 import urllib
 import urllib2
@@ -3004,8 +3005,12 @@
       parent = self._ComputeParent(remote, upstream_branch, custom_cl_base,
                                    options.force, change_desc)
       tree = RunGit(['rev-parse', 'HEAD:']).strip()
-      ref_to_push = RunGit(['commit-tree', tree, '-p', parent,
-                            '-m', change_desc.description]).strip()
+      with tempfile.NamedTemporaryFile(delete=False) as desc_tempfile:
+        desc_tempfile.write(change_desc.description)
+        desc_tempfile.close()
+        ref_to_push = RunGit(['commit-tree', tree, '-p', parent,
+                              '-F', desc_tempfile.name]).strip()
+        os.remove(desc_tempfile.name)
     else:
       change_desc = ChangeDescription(
           options.message or CreateDescriptionFromLog(git_diff_args))