summaryrefslogtreecommitdiff
path: root/git-debpush
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-07-17 08:42:43 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-17 14:12:27 +0100
commitfe4db08ba7454c40721c80e05d94f4b8532ce73f (patch)
tree9553ea213cedd5cf2a01e540f320b7987bee2eb2 /git-debpush
parentfda8aa7b7773ee59eae0701fab7a07fc0e20263b (diff)
git-debpush: check for pushing the dgit view to the maintainer view
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'git-debpush')
-rwxr-xr-xgit-debpush16
1 files changed, 12 insertions, 4 deletions
diff --git a/git-debpush b/git-debpush
index 969ee61..6c41908 100755
--- a/git-debpush
+++ b/git-debpush
@@ -201,6 +201,7 @@ trap - EXIT
# ---- Gather git history information
last_debian_tag=$(find_last_tag "debian/")
+last_archive_tag=$(find_last_tag "archive/debian/")
# ---- Useful sanity checks
@@ -208,15 +209,22 @@ if [ "$target" = "UNRELEASED" ]; then
fail_check "UNRELEASED changelog"
fi
+if ! [ "x$last_debian_tag" = "x" ] && ! [ "x$last_archive_tag" = "x" ]; then
+ last_debian_tag_c=$(git rev-parse "$last_debian_tag"^{})
+ last_archive_tag_c=$(git rev-parse "$last_archive_tag"^{})
+ if ! [ "$last_debian_tag_c" = "$last_archive_tag_c" ] \
+ && git merge-base --is-ancestor \
+ "$last_debian_tag" "$last_archive_tag"; then
+ fail_check \
+"looks like you might be trying to push the dgit view to the maintainer branch?"
+ fi
+fi
+
# TODO additional checks we might do:
#
# - are we uploading to a different suite from the last tag
# (e.g. unstable after experimental)? user should pass option to
# confirm
-#
-# - walking backwards from $branch, if there is an archive/ strictly
-# before we reach most recent debian/ tag, error, this might be a
-# push of the dgit view to the maintainer branch
if ! $force && $failed_check; then
fail "some checks failed; you can override with --force"