mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
patman: Add an option to create patches without binary contents
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> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -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
|
not later when you can't remember which patch you changed. You can always
|
||||||
go back and change or remove logs from commits.
|
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
|
Other thoughts
|
||||||
==============
|
==============
|
||||||
|
@@ -254,7 +254,7 @@ def Fetch(git_dir=None, work_tree=None):
|
|||||||
if result.return_code != 0:
|
if result.return_code != 0:
|
||||||
raise OSError('git fetch: %s' % result.stderr)
|
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.
|
"""Create a series of patches from the top of the current branch.
|
||||||
|
|
||||||
The patch files are written to the current directory using
|
The patch files are written to the current directory using
|
||||||
@@ -270,6 +270,8 @@ def CreatePatches(start, count, series):
|
|||||||
if series.get('version'):
|
if series.get('version'):
|
||||||
version = '%s ' % series['version']
|
version = '%s ' % series['version']
|
||||||
cmd = ['git', 'format-patch', '-M', '--signoff']
|
cmd = ['git', 'format-patch', '-M', '--signoff']
|
||||||
|
if ignore_binary:
|
||||||
|
cmd.append('--no-binary')
|
||||||
if series.get('cover'):
|
if series.get('cover'):
|
||||||
cmd.append('--cover-letter')
|
cmd.append('--cover-letter')
|
||||||
prefix = series.GetPatchPrefix()
|
prefix = series.GetPatchPrefix()
|
||||||
|
@@ -58,6 +58,9 @@ parser.add_option('-T', '--thread', action='store_true', dest='thread',
|
|||||||
default=False, help='Create patches as a single thread')
|
default=False, help='Create patches as a single thread')
|
||||||
parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
|
parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
|
||||||
default=None, help='Output cc list for patch file (used by git)')
|
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',
|
parser.add_option('--no-check', action='store_false', dest='check_patch',
|
||||||
default=True,
|
default=True,
|
||||||
help="Don't check for patch compliance")
|
help="Don't check for patch compliance")
|
||||||
@@ -144,7 +147,7 @@ else:
|
|||||||
if options.count:
|
if options.count:
|
||||||
series = patchstream.GetMetaData(options.start, options.count)
|
series = patchstream.GetMetaData(options.start, options.count)
|
||||||
cover_fname, args = gitutil.CreatePatches(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
|
# Fix up the patch files to our liking, and insert the cover letter
|
||||||
patchstream.FixPatches(series, args)
|
patchstream.FixPatches(series, args)
|
||||||
|
Reference in New Issue
Block a user