All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] patman: Sort the command line options
@ 2020-05-04  7:52 Bin Meng
  2020-05-04  7:52 ` [PATCH v2 2/2] patman: Add an option to create patches without binary contents Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2020-05-04  7:52 UTC (permalink / raw)
  To: u-boot

Sort the existing command line options by:

- help comes first
- option starts with '-'
- option starts with '--'

Lower case followed by upper case letters, in alphabetical order.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 tools/patman/main.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/patman/main.py b/tools/patman/main.py
index f3d9c0c..72c67b8 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -36,11 +36,11 @@ parser.add_option('-c', '--count', dest='count', type='int',
 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('-l', '--limit-cc', dest='limit', type='int',
+       default=None, help='Limit the cc list to LIMIT entries [default: %default]')
 parser.add_option('-m', '--no-maintainers', action='store_false',
        dest='add_maintainers', default=True,
        help="Don't cc the file maintainers automatically")
-parser.add_option('-l', '--limit-cc', dest='limit', type='int',
-       default=None, help='Limit the cc list to LIMIT entries [default: %default]')
 parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run',
        default=False, help="Do a dry run (create but don't email patches)")
 parser.add_option('-p', '--project', default=project.DetectProject(),
@@ -52,10 +52,10 @@ parser.add_option('-s', '--start', dest='start', type='int',
        default=0, help='Commit to start creating patches from (0 = HEAD)')
 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')
+parser.add_option('-T', '--thread', action='store_true', dest='thread',
+                  default=False, help='Create patches as a single thread')
 parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
        default=None, help='Output cc list for patch file (used by git)')
 parser.add_option('--no-check', action='store_false', dest='check_patch',
@@ -65,8 +65,8 @@ parser.add_option('--no-tags', action='store_false', dest='process_tags',
                   default=True, help="Don't process subject tags as aliaes")
 parser.add_option('--smtp-server', type='str',
                   help="Specify the SMTP server to 'git send-email'")
-parser.add_option('-T', '--thread', action='store_true', dest='thread',
-                  default=False, help='Create patches as a single thread')
+parser.add_option('--test', action='store_true', dest='test',
+                  default=False, help='run tests')
 
 parser.usage += """
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] patman: Add an option to create patches without binary contents
  2020-05-04  7:52 [PATCH v2 1/2] patman: Sort the command line options Bin Meng
@ 2020-05-04  7:52 ` Bin Meng
  2020-05-04 14:17   ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2020-05-04  7:52 UTC (permalink / raw)
  To: u-boot

Some mailing lists have size limits and when we add binary contents
to our patches it's easy to exceed the size limits.

Git supports a command line option "--no-binary" to generate patches
without any binary contents. Add an option in patman to handle this.
Note with this option patches cannot be applied properly, but they
are still useful for code review.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

Changes in v2:
- update documentation to mention the new option

 tools/patman/README     | 5 +++++
 tools/patman/gitutil.py | 4 +++-
 tools/patman/main.py    | 5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/patman/README b/tools/patman/README
index 02d5829..f40defb 100644
--- a/tools/patman/README
+++ b/tools/patman/README
@@ -474,6 +474,11 @@ print out the command line patman would have used.
 not later when you can't remember which patch you changed. You can always
 go back and change or remove logs from commits.
 
+7. Some mailing lists have size limits and when we add binary contents to
+our patches it's easy to exceed the size limits. Use "--no-binary" to
+generate patches without any binary contents. You are supposed to include
+a link to a git repository in your "Commit-notes", "Series-notes" or
+"Cover-letter" for maintainers to fetch the original commit.
 
 Other thoughts
 ==============
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 770a051..72fc95d 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -254,7 +254,7 @@ def Fetch(git_dir=None, work_tree=None):
     if result.return_code != 0:
         raise OSError('git fetch: %s' % result.stderr)
 
-def CreatePatches(start, count, series):
+def CreatePatches(start, count, ignore_binary, series):
     """Create a series of patches from the top of the current branch.
 
     The patch files are written to the current directory using
@@ -270,6 +270,8 @@ def CreatePatches(start, count, series):
     if series.get('version'):
         version = '%s ' % series['version']
     cmd = ['git', 'format-patch', '-M', '--signoff']
+    if ignore_binary:
+        cmd.append('--no-binary')
     if series.get('cover'):
         cmd.append('--cover-letter')
     prefix = series.GetPatchPrefix()
diff --git a/tools/patman/main.py b/tools/patman/main.py
index 72c67b8..2951836 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -58,6 +58,9 @@ parser.add_option('-T', '--thread', action='store_true', dest='thread',
                   default=False, help='Create patches as a single thread')
 parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
        default=None, help='Output cc list for patch file (used by git)')
+parser.add_option('--no-binary', action='store_true', dest='ignore_binary',
+                  default=False,
+                  help="Do not output contents of changes in binary files")
 parser.add_option('--no-check', action='store_false', dest='check_patch',
                   default=True,
                   help="Don't check for patch compliance")
@@ -144,7 +147,7 @@ else:
     if options.count:
         series = patchstream.GetMetaData(options.start, options.count)
         cover_fname, args = gitutil.CreatePatches(options.start, options.count,
-                series)
+                options.ignore_binary, series)
 
     # Fix up the patch files to our liking, and insert the cover letter
     patchstream.FixPatches(series, args)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] patman: Add an option to create patches without binary contents
  2020-05-04  7:52 ` [PATCH v2 2/2] patman: Add an option to create patches without binary contents Bin Meng
@ 2020-05-04 14:17   ` Simon Glass
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-05-04 14:17 UTC (permalink / raw)
  To: u-boot

On Mon, 4 May 2020 at 01:52, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Some mailing lists have size limits and when we add binary contents
> to our patches it's easy to exceed the size limits.
>
> Git supports a command line option "--no-binary" to generate patches
> without any binary contents. Add an option in patman to handle this.
> Note with this option patches cannot be applied properly, but they
> are still useful for code review.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> ---
>
> Changes in v2:
> - update documentation to mention the new option
>
>  tools/patman/README     | 5 +++++
>  tools/patman/gitutil.py | 4 +++-
>  tools/patman/main.py    | 5 ++++-
>  3 files changed, 12 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-04 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04  7:52 [PATCH v2 1/2] patman: Sort the command line options Bin Meng
2020-05-04  7:52 ` [PATCH v2 2/2] patman: Add an option to create patches without binary contents Bin Meng
2020-05-04 14:17   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.