|
from huggingface_hub import HfApi |
|
|
|
|
|
repo_id = "soiz1/s4s-editor" |
|
repo_type = "space" |
|
|
|
|
|
exclude = { |
|
"d597f12958d455343f3e615926b940275157dd6a", |
|
"6bcb42f9f3a292e3ee572372ca4dd19054e51b3f" |
|
} |
|
|
|
api = HfApi() |
|
|
|
|
|
commits = api.list_repo_commits(repo_id=repo_id, repo_type=repo_type) |
|
|
|
|
|
files = set() |
|
|
|
for commit in commits: |
|
commit_id = commit.commit_id |
|
if commit_id in exclude: |
|
continue |
|
|
|
|
|
diff = api.get_commit_diff( |
|
repo_id=repo_id, |
|
repo_type=repo_type, |
|
revision=commit_id |
|
) |
|
|
|
|
|
for line in diff.splitlines(): |
|
if line.startswith("diff --git"): |
|
parts = line.split() |
|
if len(parts) >= 4: |
|
a = parts[2][2:] |
|
b = parts[3][2:] |
|
files.add(a if a == b else a) |
|
|
|
|
|
print("修正されたファイル一覧(除外コミット以外):") |
|
for f in sorted(files): |
|
print(f) |
|
|