MCPcopy Create free account
hub / github.com/openai/openai-agents-python / git_last_commit_timestamp

Function git_last_commit_timestamp

docs/scripts/translate_docs.py:374–390  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

372
373
374def git_last_commit_timestamp(path: str) -> int:
375 try:
376 relative_path = os.path.relpath(path, REPO_ROOT)
377 result = subprocess.run(
378 ["git", "-C", str(REPO_ROOT), "log", "-1", "--format=%ct", "--", relative_path],
379 capture_output=True,
380 text=True,
381 check=False,
382 )
383 if result.returncode != 0:
384 return 0
385 output = result.stdout.strip()
386 if not output:
387 return 0
388 return int(output)
389 except Exception:
390 return 0
391
392
393def should_translate_based_on_translation(file_path: str) -> bool:

Callers 1

Calls 2

relpathMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected