From 6d819925d0781b1fa8e5526f73cd277449dc08e1 Mon Sep 17 00:00:00 2001 From: Doug Anderson Date: Sun, 17 Mar 2013 10:31:04 +0000 Subject: 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. Signed-off-by: Doug Anderson Acked-by: Simon Glass --- tools/patman/patman.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/patman/patman.py') diff --git a/tools/patman/patman.py b/tools/patman/patman.py index e049081eae..377408d049 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -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: -- cgit v1.2.1 From ca706e768d01ee30bb0e6f6af7ca65b5a244b56d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 26 Mar 2013 13:09:45 +0000 Subject: patman: Minor help message/README fixes A few of the help messages are not quite right, and there is a typo in the README. Fix these. Signed-off-by: Simon Glass Reviewed-by: Doug Anderson --- tools/patman/patman.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/patman/patman.py') diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 377408d049..5000b7db25 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -49,7 +49,7 @@ parser.add_option('-i', '--ignore-errors', action='store_true', dest='ignore_errors', default=False, help='Send patches email even if patch errors are found') parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run', - default=False, help="Do a try run (create but don't email patches)") + default=False, help="Do a dry run (create but don't email patches)") parser.add_option('-p', '--project', default=project.DetectProject(), help="Project name; affects default option values and " "aliases [default: %default]") @@ -72,7 +72,7 @@ parser.add_option('--no-tags', action='store_false', dest='process_tags', parser.usage = """patman [options] Create patches from commits in a branch, check them and email them as -specified by tags you place in the commits. Use -n to """ +specified by tags you place in the commits. Use -n to do a dry run first.""" # Parse options twice: first to get the project and second to handle -- cgit v1.2.1 From a1318f7cdc2fcff3b30d39750dd07dbed8f03f21 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 26 Mar 2013 13:09:42 +0000 Subject: patman: Provide option to ignore bad aliases Often it happens that patches include tags which don't have aliases. It is annoying that patman fails in this case, and provides no option to continue other than adding empty tags to the .patman file. Correct this by adding a '-t' option to ignore tags that don't exist. Print a warning instead. Since running the tests is not a common operation, move this to --test instead, to reserve -t for this new option. Signed-off-by: Simon Glass Reviewed-by: Doug Anderson --- tools/patman/patman.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/patman/patman.py') diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 5000b7db25..23026becd0 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -57,7 +57,9 @@ 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', +parser.add_option('-t', '--ignore-bad-tags', action='store_true', + default=False, help='Ignore bad tags / aliases') +parser.add_option('--test', action='store_true', dest='test', default=False, help='run tests') parser.add_option('-v', '--verbose', action='store_true', dest='verbose', default=False, help='Verbose output of errors and warnings') @@ -159,13 +161,15 @@ else: options.count + options.start): ok = False - cc_file = series.MakeCcFile(options.process_tags, cover_fname) + cc_file = series.MakeCcFile(options.process_tags, cover_fname, + not options.ignore_bad_tags) # Email the patches out (giving the user time to check / cancel) cmd = '' if ok or options.ignore_errors: cmd = gitutil.EmailPatches(series, cover_fname, args, - options.dry_run, cc_file, in_reply_to=options.in_reply_to) + options.dry_run, not options.ignore_bad_tags, 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: -- cgit v1.2.1 From 902a9715eaef60e75f842381df485b76e5082c4f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 26 Mar 2013 13:09:43 +0000 Subject: patman: Add -a option to refrain from test-applying the patches Especially with the Linux kernel, it takes a long time (a minute or more) to test-apply the patches, so patman becomes significantly less useful. The only real problem that is found with this apply step is trailing spaces. Provide a -a option to skip this step, for those working with clean patches. Signed-off-by: Simon Glass Reviewed-by: Doug Anderson --- tools/patman/patman.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/patman/patman.py') diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 23026becd0..a8061a9372 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -41,6 +41,9 @@ import test parser = OptionParser() +parser.add_option('-a', '--no-apply', action='store_false', + dest='apply_patches', default=True, + help="Don't test-apply patches with git am") parser.add_option('-H', '--full-help', action='store_true', dest='full_help', default=False, help='Display the README file') parser.add_option('-c', '--count', dest='count', type='int', @@ -157,9 +160,10 @@ else: ok = checkpatch.CheckPatches(options.verbose, args) else: ok = True - if not gitutil.ApplyPatches(options.verbose, args, - options.count + options.start): - ok = False + if options.apply_patches: + if not gitutil.ApplyPatches(options.verbose, args, + options.count + options.start): + ok = False cc_file = series.MakeCcFile(options.process_tags, cover_fname, not options.ignore_bad_tags) -- cgit v1.2.1