diff --git a/scripts/generate-contributors.sh b/scripts/generate-contributors.sh index 6a03d1e3..af7fc3f9 100755 --- a/scripts/generate-contributors.sh +++ b/scripts/generate-contributors.sh @@ -171,6 +171,13 @@ else: subprocess.run(['git', 'add', csv_file], check=True) + # Check if there are actual changes to commit + diff_result = subprocess.run(['git', 'diff', '--cached', '--quiet'], capture_output=True) + if diff_result.returncode == 0: + # No changes staged, skip this commit + print(f"[UPDATE {i}/{len(updated_prompts)}] {act} - no changes, skipping") + continue + env = os.environ.copy() env['GIT_AUTHOR_NAME'] = primary_author env['GIT_AUTHOR_EMAIL'] = email @@ -207,6 +214,12 @@ else: # Stage and commit subprocess.run(['git', 'add', csv_file], check=True) + # Check if there are actual changes to commit + diff_result = subprocess.run(['git', 'diff', '--cached', '--quiet'], capture_output=True) + if diff_result.returncode == 0: + print(f"[NEW {i}/{len(new_prompts)}] {act} - no changes, skipping") + continue + env = os.environ.copy() env['GIT_AUTHOR_NAME'] = primary_author env['GIT_AUTHOR_EMAIL'] = email @@ -249,6 +262,12 @@ else: # Stage and commit subprocess.run(['git', 'add', csv_file], check=True) + # Check if there are actual changes to commit + diff_result = subprocess.run(['git', 'diff', '--cached', '--quiet'], capture_output=True) + if diff_result.returncode == 0: + print(f"[REMOVE {i}/{len(deleted_prompts)}] {act} - no changes, skipping") + continue + env = os.environ.copy() env['GIT_AUTHOR_NAME'] = primary_author env['GIT_AUTHOR_EMAIL'] = email