build: minor fixes to git-export-patches (#17276)
* fix: make export-patches robust to tags with dashes * fix: --output is a required parameter of export-patches
This commit is contained in:
parent
ca2c345997
commit
825e526456
1 changed files with 3 additions and 2 deletions
|
@ -16,7 +16,7 @@ def guess_base_commit(repo):
|
||||||
'describe',
|
'describe',
|
||||||
'--tags',
|
'--tags',
|
||||||
]
|
]
|
||||||
return subprocess.check_output(args).split('-')[0:2]
|
return subprocess.check_output(args).rsplit('-', 2)[0:2]
|
||||||
|
|
||||||
|
|
||||||
def format_patch(repo, since):
|
def format_patch(repo, since):
|
||||||
|
@ -92,7 +92,8 @@ def remove_patch_filename(patch):
|
||||||
def main(argv):
|
def main(argv):
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-o", "--output",
|
parser.add_argument("-o", "--output",
|
||||||
help="directory into which exported patches will be written")
|
help="directory into which exported patches will be written",
|
||||||
|
required=True)
|
||||||
parser.add_argument("patch_range",
|
parser.add_argument("patch_range",
|
||||||
nargs='?',
|
nargs='?',
|
||||||
help="range of patches to export. Defaults to all commits since the "
|
help="range of patches to export. Defaults to all commits since the "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue