Compare commits
No commits in common. "master" and "r4.05" have entirely different histories.
9
tagger
9
tagger
|
@ -10,7 +10,6 @@ ap.add_argument("--fullyear", action="store_true")
|
|||
ap.add_argument("--day-always", action="store_true")
|
||||
ap.add_argument("--prefix", default="r")
|
||||
ap.add_argument("--noop", action="store_true")
|
||||
ap.add_argument("--force", action="store_true")
|
||||
args = ap.parse_args()
|
||||
|
||||
subprocess.run(["git", "pull"])
|
||||
|
@ -20,7 +19,9 @@ need_tag = False
|
|||
max_major = 0
|
||||
for ln in result.stdout.split("\n"):
|
||||
|
||||
for tag in re.findall(r"\btag: ([-a-z0-9._]+)", ln):
|
||||
m = re.match(r"[0-9a-f]+ .*\btag: ([-a-z0-9._]+)", ln)
|
||||
if m:
|
||||
tag = m.group(1)
|
||||
if tag.startswith(args.prefix):
|
||||
found_tags.add(tag)
|
||||
try:
|
||||
|
@ -34,7 +35,7 @@ for ln in result.stdout.split("\n"):
|
|||
need_tag = True
|
||||
|
||||
print(need_tag, found_tags)
|
||||
if need_tag or args.force:
|
||||
if need_tag:
|
||||
today = datetime.date.today()
|
||||
version = []
|
||||
if args.fullyear:
|
||||
|
@ -45,8 +46,6 @@ if need_tag or args.force:
|
|||
if year % m >= max_major:
|
||||
major = str(year % m)
|
||||
break
|
||||
else:
|
||||
major = str(year)
|
||||
version.append(major)
|
||||
version.append(today.strftime("%m"))
|
||||
if args.day_always:
|
||||
|
|
Loading…
Reference in New Issue