]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
patman: Allow specifying the message ID your series is in reply to
authorDoug Anderson <dianders@chromium.org>
Sun, 17 Mar 2013 10:31:04 +0000 (10:31 +0000)
committerSimon Glass <sjg@chromium.org>
Thu, 4 Apr 2013 21:04:34 +0000 (14:04 -0700)
Some versions of git don't seem to prompt you for the message ID that
your series is in reply to.  Allow specifying this from the command
line.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
tools/patman/gitutil.py
tools/patman/patman.py

index 99fac795c20d5fd0b47a7fc96cbb72370b200cec..4e21d4c2a778acaa642479859691b8287b269196 100644 (file)
@@ -317,7 +317,7 @@ def BuildEmailList(in_list, tag=None, alias=None):
     return result
 
 def EmailPatches(series, cover_fname, args, dry_run, cc_fname,
-        self_only=False, alias=None):
+        self_only=False, alias=None, in_reply_to=None):
     """Email a patch series.
 
     Args:
@@ -327,6 +327,8 @@ def EmailPatches(series, cover_fname, args, dry_run, cc_fname,
         dry_run: Just return the command that would be run
         cc_fname: Filename of Cc file for per-commit Cc
         self_only: True to just email to yourself as a test
+        in_reply_to: If set we'll pass this to git as --in-reply-to.
+            Should be a message ID that this is in reply to.
 
     Returns:
         Git command that was/would be run
@@ -376,6 +378,9 @@ def EmailPatches(series, cover_fname, args, dry_run, cc_fname,
         to = BuildEmailList([os.getenv('USER')], '--to', alias)
         cc = []
     cmd = ['git', 'send-email', '--annotate']
+    if in_reply_to:
+        cmd.append('--in-reply-to="%s"' % in_reply_to)
+
     cmd += to
     cmd += cc
     cmd += ['--cc-cmd', '"%s --cc-cmd %s"' % (sys.argv[0], cc_fname)]
index e049081eae7d9050d91ee5a3b063f6d583417ec3..377408d04950733239021551b16841d3d132d2cc 100755 (executable)
@@ -53,6 +53,8 @@ parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run',
 parser.add_option('-p', '--project', default=project.DetectProject(),
                   help="Project name; affects default option values and "
                   "aliases [default: %default]")
+parser.add_option('-r', '--in-reply-to', type='string', action='store',
+                  help="Message ID that this series is in reply to")
 parser.add_option('-s', '--start', dest='start', type='int',
        default=0, help='Commit to start creating patches from (0 = HEAD)')
 parser.add_option('-t', '--test', action='store_true', dest='test',
@@ -163,7 +165,7 @@ else:
     cmd = ''
     if ok or options.ignore_errors:
         cmd = gitutil.EmailPatches(series, cover_fname, args,
-                options.dry_run, cc_file)
+                options.dry_run, cc_file, in_reply_to=options.in_reply_to)
 
     # For a dry run, just show our actions as a sanity check
     if options.dry_run: