diff options
-rw-r--r-- | data/share/bash-completion/completions/pkgdev | 1 | ||||
-rw-r--r-- | data/share/zsh/site-functions/_pkgdev | 1 | ||||
-rw-r--r-- | src/pkgdev/scripts/pkgdev_push.py | 6 |
3 files changed, 8 insertions, 0 deletions
diff --git a/data/share/bash-completion/completions/pkgdev b/data/share/bash-completion/completions/pkgdev index 1408292..9094ab1 100644 --- a/data/share/bash-completion/completions/pkgdev +++ b/data/share/bash-completion/completions/pkgdev @@ -134,6 +134,7 @@ _pkgdev() { subcmd_options=" -A --ask -n --dry-run + --pull " COMPREPLY+=($(compgen -W "${subcmd_options}" -- "${cur}")) diff --git a/data/share/zsh/site-functions/_pkgdev b/data/share/zsh/site-functions/_pkgdev index f2c95bc..32b927f 100644 --- a/data/share/zsh/site-functions/_pkgdev +++ b/data/share/zsh/site-functions/_pkgdev @@ -77,6 +77,7 @@ case $state in $base_options \ {'(--ask)-A','(-A)--ask'}'[confirm pushing commits with QA errors]' \ {'(--dry-run)-n','(-n)--dry-run'}'[pretend to push commits]' \ + '--pull[run git pull --rebase before scanning]' \ && ret=0 ;; (showkw) diff --git a/src/pkgdev/scripts/pkgdev_push.py b/src/pkgdev/scripts/pkgdev_push.py index d33f8da..facba8d 100644 --- a/src/pkgdev/scripts/pkgdev_push.py +++ b/src/pkgdev/scripts/pkgdev_push.py @@ -32,6 +32,9 @@ push_opts.add_argument( push_opts.add_argument( '-n', '--dry-run', action='store_true', help='pretend to push the commits') +push_opts.add_argument( + '--pull', action='store_true', + help='run `git pull --rebase` before scanning') @push.bind_final_check @@ -45,6 +48,9 @@ def _commit_validate(parser, namespace): @push.bind_main_func def _push(options, out, err): + if options.pull: + git.run('pull', '--rebase', cwd=options.repo.location) + # scan commits for QA issues pipe = scan(options.scan_args) with reporters.FancyReporter(out) as reporter: |