]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ignore branches not updated in 2 years
authorMartin Taibr <taibr.martin@gmail.com>
Sat, 23 Sep 2017 00:35:21 +0000 (02:35 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Sat, 23 Sep 2017 00:35:21 +0000 (02:35 +0200)
qcsrc/tools/uncrustify-unmodified.py

index 83b5d0987db6e320422b7b28227c5f8f106a5afc..c9c558428ab79adc64d3aa9bb49cabc0f9bdf263 100755 (executable)
@@ -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