# **** Helper functions and variables ****
us="$(basename $0)"
+git_playtree_setup=git-playtree-setup ###substituted###
+git_playtree_setup=${DEBPUSH_GIT_PLAYTREE_SETUP-$git_playtree_setup}
cleanup() {
if [ -d "$temp" ]; then
fi
}
+fail_check_upstream_nonidentical () {
+ fail_check upstream-nonidentical \
+ "the upstream source in tag $upstream_tag is not identical to the upstream source in $branch"
+}
+
find_last_tag () {
local prefix=$1
set -o pipefail
}
+check_treesame () {
+ local first=$1
+ local second=$2
+ shift 2
+
+ set +e
+ git diff --quiet --exit-code "$first".."$second" -- . "$@"
+ git_diff_rc=$?
+ set -e
+
+ # show the user what the difference was
+ if [ $git_diff_rc = 1 ]; then
+ git diff --compact-summary "$first".."$second" -- . "$@"
+ fi
+
+ if [ $git_diff_rc -le 1 ]; then
+ return $git_diff_rc
+ else
+ fail "'git diff' exited with unexpected code $git_diff_rc"
+ fi
+}
+
# **** Parse command line ****
getopt=$(getopt -s bash -o 'nfu:' \
'3.0 (quilt)') upstream=true ;;
'3.0 (native)') upstream=false ;;
'1.0'|'')
- if get_file_from_ref debian/source/options | grep '^-sn *$'; then
+ if get_file_from_ref debian/source/options | grep -q '^-sn *$'; then
upstream=false
- elif get_file_from_ref debian/source/options | grep '^-sk *$'; then
+ elif get_file_from_ref debian/source/options | grep -q '^-sk *$'; then
upstream=true
else
fail 'please see "SOURCE FORMAT 1.0" in git-debpush(1)'
"upstream tag $upstream_tag is not an ancestor of $branch; probably a mistake"
fi
+# ---- Upstream tag tree nonidentical
+
+case "$quilt_mode" in
+ gbp)
+ check_treesame "$upstream_tag" "$branch" ':!debian' ':!**.gitignore' \
+ || fail_check_upstream_nonidentical
+ ;;
+ unapplied)
+ check_treesame "$upstream_tag" "$branch" ':!debian' \
+ || fail_check_upstream_nonidentical
+ ;;
+esac
+
# ---- Summary
if $failed_check; then
fi
fi
-git tag "${git_tag_opts[@]}" -s -F- "$debian_tag" "$branch" <<EOF
-$source release $version for $target
+tagmessage="$source release $version for $target
[dgit distro=$distro split$quilt_mode_text]
[dgit please-upload$upstream_info]
-EOF
+"
+
+git tag "${git_tag_opts[@]}" -s -m "$tagmessage" "$debian_tag" "$branch"
# **** Do a git push ****