2022-04-12 11:21:55 +00:00
|
|
|
#!/usr/bin/env python3
|
2018-10-24 18:24:11 +00:00
|
|
|
|
|
|
|
import argparse
|
|
|
|
import sys
|
|
|
|
|
2020-04-08 15:59:14 +00:00
|
|
|
from lib import git
|
2018-10-24 18:24:11 +00:00
|
|
|
|
|
|
|
def main(argv):
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("-o", "--output",
|
2019-03-07 23:59:17 +00:00
|
|
|
help="directory into which exported patches will be written",
|
|
|
|
required=True)
|
2024-02-08 18:47:59 +00:00
|
|
|
parser.add_argument("--grep",
|
|
|
|
help="only export patches matching a keyword")
|
2018-10-24 18:24:11 +00:00
|
|
|
parser.add_argument("patch_range",
|
|
|
|
nargs='?',
|
|
|
|
help="range of patches to export. Defaults to all commits since the "
|
|
|
|
"most recent tag or remote branch.")
|
|
|
|
args = parser.parse_args(argv)
|
|
|
|
|
2024-02-08 18:47:59 +00:00
|
|
|
git.export_patches('.', args.output, patch_range=args.patch_range, grep=args.grep)
|
2018-10-24 18:24:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main(sys.argv[1:])
|