From: Martin Taibr Date: Sat, 23 Sep 2017 00:35:21 +0000 (+0200) Subject: ignore branches not updated in 2 years X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=172f1ee603bb0bf287d2535ab7e038a0b1d78326;p=xonotic%2Fxonotic-data.pk3dir.git ignore branches not updated in 2 years --- diff --git a/qcsrc/tools/uncrustify-unmodified.py b/qcsrc/tools/uncrustify-unmodified.py index 83b5d0987..c9c558428 100755 --- a/qcsrc/tools/uncrustify-unmodified.py +++ b/qcsrc/tools/uncrustify-unmodified.py @@ -6,6 +6,8 @@ # If you're on Windows, you probably wanna fix path separators and maybe other tihngs, I am not touching that. +from datetime import datetime, timedelta, timezone +from dateutil import parser import glob import os.path import shlex @@ -35,8 +37,13 @@ def main(): print(branch) # getting this info is a bit slow - last_change = run(r'git show --pretty=format:"%ci" {}'.format(branch))[0] - print("\t last change:", last_change) + last_change_str = run(r'git show --pretty=format:"%ci" {}'.format(branch))[0] + print("\t last change:", last_change_str) + + last_change = parser.parse(last_change_str) + if datetime.now(timezone.utc) - last_change > timedelta(days=365*2): # who cares about leap years + print("\t ignoring") + continue # If some complex branching and merging happens, there can be multiple merge bases. # The diff between each of them and the tip of the branch can contain changes that are not in master