MCPcopy Create free account
hub / github.com/ElementsProject/elements / get_git_change_years

Function get_git_change_years

contrib/devtools/copyright_header.py:308–313  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

306 return out.decode("utf-8").split('\n')
307
308def get_git_change_years(filename):
309 git_log_lines = call_git_log(filename)
310 if len(git_log_lines) == 0:
311 return [datetime.date.today().year]
312 # timestamp is in ISO 8601 format. e.g. "2016-09-05 14:25:32 -0600"
313 return [line.split(' ')[0].split('-')[0] for line in git_log_lines]
314
315def get_most_recent_git_change_year(filename):
316 return max(get_git_change_years(filename))

Callers 2

Calls 1

call_git_logFunction · 0.85

Tested by

no test coverage detected