Skip to content

Commit 98be22c

Browse files
FozzTexxtschak909
authored andcommitted
By default, don't use most recent modified date since it causes everything to rebuild.
1 parent 07507f2 commit 98be22c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

debug_version.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
def build_argparser():
1818
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
19+
parser.add_argument("--use_modified_date", action="store_true",
20+
help="use date of newest modified file instead of commit date")
1921
parser.add_argument("--update_version_h", action="store_true",
2022
help="update include/version.h with current commit information")
2123
return parser
@@ -70,11 +72,12 @@ def main():
7072
commit_id_long = run_command(["git", "rev-parse", "HEAD"])
7173

7274
mtime = int(run_command(["git", "show", "--no-patch", "--format=%ct", "HEAD"]))
73-
for path in modified:
74-
if os.path.exists(path):
75-
mt = os.path.getmtime(path)
76-
if not mtime or mt > mtime:
77-
mtime = mt
75+
if args.use_modified_date:
76+
for path in modified:
77+
if os.path.exists(path):
78+
mt = os.path.getmtime(path)
79+
if not mtime or mt > mtime:
80+
mtime = mt
7881

7982
macros = {
8083
'FN_VERSION_BUILD': commit_id_long,

0 commit comments

Comments
 (0)