diff options
Diffstat (limited to 'git-debpush')
-rwxr-xr-x | git-debpush | 16 |
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" |