From 4a6f56f6197d76a436c63a2794baf3808687fb2e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 6 Jul 2019 23:54:54 +0100 Subject: [PATCH] git-debpush: Support --upstream=TAG (and document it) Signed-off-by: Ian Jackson --- git-debpush | 10 ++++++---- git-debpush.1.pod | 9 +++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/git-debpush b/git-debpush index e9b64d4a..5ffbd52c 100755 --- a/git-debpush +++ b/git-debpush @@ -66,7 +66,7 @@ get_file_from_ref () { # ---- Parse command line getopt=$(getopt -s bash -o 'nfu:' \ - -l 'no-push,force,branch:,remote:,distro:,quilt:,gbp,dpm,\ + -l 'no-push,force,branch:,remote:,distro:,upstream:,quilt:,gbp,dpm,\ baredebian,baredebian+git,baredebian+tarball' \ -n "$us" -- "$@") eval "set - $getopt" @@ -90,6 +90,7 @@ while true; do '--remote') remote=$2; shift 2; continue ;; '--distro') distro=$2; shift 2; continue ;; '--quilt') quilt_mode=$2; shift 2; continue ;; + '--upstream') upstream_tag=$2; shift 2; continue ;; '--baredebian'|'--baredebian+git') quilt_mode=baredebian; shift; continue ;; @@ -214,9 +215,10 @@ esac upstream_info="" if $upstream; then - # xxx want way to override this - upstream_tag=$(git deborig --just-print --version="$version" \ - | head -n1) + if [ "x$upstream_tag" = x ]; then + upstream_tag=$(git deborig --just-print --version="$version" \ + | head -n1) + fi upstream_committish=$(git rev-parse "refs/tags/${upstream_tag}"^{}) upstream_info=" upstream-tag=$upstream_tag upstream=$upstream_committish" fi diff --git a/git-debpush.1.pod b/git-debpush.1.pod index 926e8cd3..f1edf776 100644 --- a/git-debpush.1.pod +++ b/git-debpush.1.pod @@ -168,6 +168,15 @@ Note that this need not actually be a branch, but any committish (see gitglossary(7)). The option name is chosen to fit what is by far the most common case. +=item B<--upstream=>I + +When pushing a non-native package, +git-debpush needs a tag for the upstream part of your package. + +By default git-debpush asks git-deborig, +which searches for a suitable tag in your tree, +based on the upstream version. + =item B<--remote=>I Where to push tags and branches. If unspecified, use the remote which -- 2.30.2