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>
This commit is contained in:
parent
818a84c4b2
commit
e7a471a8fb
1 changed files with 9 additions and 0 deletions
9
logerrit
9
logerrit
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue