Skip to contentSkip to conversation

patman: Allow specifying the message ID your series is in reply to

PATCH Superseded Doug Anderson 3 participants 4 messages Mar 15, 2013 – Mar 17, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patman: Allow specifying the message ID your series is in reply to

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.

---
 tools/patman/gitutil.py | 7 ++++++-
 tools/patman/patman.py  | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +6 -1
index ca3ba4a..f40bbb4 100644
@@ -203,7 +203,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:
@@ -213,6 +213,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 non-None 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
@@ -262,6 +264,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)]
tools/patman/patman.py +3 -1
index e049081..377408d 100755
@@ -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:
Signature · 1 line
1.8.1.3
#1 lore raw

PATCH 1/1 patman: Allow specifying the message ID your series is in reply to

Quoted 24 lines · Doug Anderson

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.

---
 tools/patman/gitutil.py | 7 ++++++-
 tools/patman/patman.py  | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +1 -1
index ca3ba4a..f40bbb4 100644
@@ -203,7 +203,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:

tools/patman/gitutil.py def EmailPatches(series, cover_fname, args, dry_run, cc_fname, · line 216

Quoted 4 lines
tools/patman/gitutil.py +1 -0
@@ -213,6 +213,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 non-None we'll pass this to git as --in-reply-to.

...: If set we'll pass this to git ...

Quoted 43 lines
tools/patman/gitutil.py +4 -0
+            Should be a message ID that this is in reply to.
 
     Returns:
         Git command that was/would be run
@@ -262,6 +264,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)]
tools/patman/patman.py +3 -2
index e049081..377408d 100755
@@ -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:
--

1.8.1.3

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#2 lore raw

PATCH 1/1 patman: Allow specifying the message ID your series is in reply to

Hi Doug,

Quoted 6 lines · Otavio Salvador
Quoted 5 lines · Doug Anderson

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.

With the nit fixed:

Thanks for sending this - this seems to be an important fix now that git's behaviour is different.

Regards,
Simon

#3 lore raw

PATCH v2 1/1 patman: Allow specifying the message ID your series is in reply to

In reply to Doug Anderson

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.

---
Changes in v2:
- Adjusted docstring wording as per Otavio Salvador.

 tools/patman/gitutil.py | 7 ++++++-
 tools/patman/patman.py  | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)
tools/patman/gitutil.py +6 -1
index ca3ba4a..c35d209 100644
@@ -203,7 +203,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:
@@ -213,6 +213,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
@@ -262,6 +264,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)]
tools/patman/patman.py +3 -1
index e049081..377408d 100755
@@ -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:
Signature · 1 line
1.8.1.3