diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-03-05 12:33:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-03-08 09:27:19 +0100 |
commit | e7a471a8fbac22877973af7e7be8c6a0701b4046 (patch) | |
tree | d109e0f6e85a0ee310b744fab9d128a46e29eeba /logerrit | |
parent | 818a84c4b232518780ff12415a6dad50b3625d5d (diff) |
logerrit: do not submit if parent is older than a week
Change-Id: Ieb20b3086082bd0a88e457b0ae922234ce737b8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112009
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'logerrit')
-rwxr-xr-x | logerrit | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -22,6 +22,15 @@ submit() { fi echo "no branch specified, guessing current branch $BRANCH" fi + + if [ "$BRANCH" = "master" ]; then + WEEKOLDDATE=$(date --date="7 days ago" +%s) + PARENTDATE=$(git show -s --format=%ct HEAD~1) + if [[ $PARENTDATE -lt $WEEKOLDDATE ]]; then + echo "Your branch is older than a week, do './g pull -r' and retry" + exit 1 + fi + fi git push "$GERRITURL" "HEAD:refs/for/$BRANCH$TYPE" } |