xref: /aosp_15_r20/external/minijail/tools/repo_upload_warning (revision 4b9c6d91573e8b3a96609339b46361b5476dd0f9)
1#!/usr/bin/env bash
2
3if git log -n 1 --format='%B' $1 | grep -q -E "^Ignore-Upstream-First: .+" ; then
4  # Change is explicitly marked as ok to skip upstream
5  exit 0
6elif git log -n 1 --format='%s' $1 | grep -q -E "^(UPSTREAM|Upstream): .+" ; then
7  # Change is explicitly marked as coming from the upstream
8  exit 0
9fi
10
11echo "WARNING: Here is not the upstream."
12echo ""
13echo "Do not submit changes to this repository directly. Please submit changes to upstream"
14echo "from https://chromium-review.googlesource.com/q/project:chromiumos/platform/minijail"
15echo ""
16echo "If the change is from the upstream, please prepend \"UPSTREAM: \" to the subject."
17echo ""
18echo "If indeed necessary, please add \"Ignore-Upstream-First: <reason>\" to commit message"
19echo "to bypass."
20
21exit 1
22