diff options
author | Jared Camins-Esakov <jcamins@cpbibliography.com> | 2012-11-02 08:00:17 -0400 |
---|---|---|
committer | Jared Camins-Esakov <jcamins@cpbibliography.com> | 2012-11-06 16:18:52 -0500 |
commit | c4a84e727c5fde94acbe60aa61e449399861db2b (patch) | |
tree | c099d66c7fc0638e1d58e54261d7ada03080a555 | |
parent | 5b32af9bc1f41f21035f893bc0ad37aaeee017bd (diff) | |
download | git-bz-c4a84e727c5fde94acbe60aa61e449399861db2b.tar.gz |
Teach git-bz to optionally sign off when applying patches
Adds a -s/--signoff option for the apply action. When set, git-bz
will instruct git-am to sign off on all patches as they are being
applied.
WARNING: THIS OPTION IS INTENDED FOR USE WHEN PUSHING BRANCHES. DO
NOT USE THIS OPTION AS AN ALTERNATIVE TO ACTUALLY TESTING CODE.
Conflicts:
git-bz
-rwxr-xr-x | git-bz | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -1734,8 +1734,12 @@ FIXME: need commit message. f.close() try: - process = git.am("-3", filename, resolvemsg=resolvemsg, - _interactive=True) + if global_options.signoff: + process = git.am("-3", "-s", filename, resolvemsg=resolvemsg, + _interactive=True) + else: + process = git.am("-3", filename, resolvemsg=resolvemsg, + _interactive=True) except CalledProcessError: if os.access(git_dir + "/rebase-apply", os.F_OK): # git-am saved its state for an abort or continue, @@ -2438,6 +2442,10 @@ def add_fix_option(): parser.add_option("", "--fix", metavar="<bug reference>", help="attach commits and close bug") +def add_signoff_option(): + parser.add_option("-s", "--signoff", action="store_true", + help="sign off when applying") + if command == 'add-url': parser.set_usage("git bz add-url [options] <bug reference> (<commit> | <revision range>)"); min_args = max_args = 2 @@ -2456,6 +2464,7 @@ elif command == 'apply': add_add_url_options() min_args = 0 max_args = 1 + add_signoff_option() elif command == 'attach': parser.set_usage("git bz attach [options] [<bug reference>] (<commit> | <revision range>)"); |