diff --git a/read_changelog.py b/read_changelog.py deleted file mode 100644 index e8860650e..000000000 --- a/read_changelog.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -import subprocess -import os - -repo_path = "/tmp/cleverthis-1778458782191713897/repo" - -# 1. wc -l CHANGELOG.md -print("=" * 60) -print("1. wc -l CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["wc", "-l", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) -print(f"stdout: {result.stdout!r}") -print(f"stderr: {result.stderr!r}") -print(f"returncode: {result.returncode}") - -# 2. head -50 CHANGELOG.md -print() -print("=" * 60) -print("2. head -50 CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["head", "-50", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) -print(f"stdout: {result.stdout!r}") -print(f"stderr: {result.stderr!r}") -print(f"returncode: {result.returncode}") - -# 3. tail -20 CHANGELOG.md -print() -print("=" * 60) -print("3. tail -20 CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["tail", "-20", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) -print(f"stdout: {result.stdout!r}") -print(f"stderr: {result.stderr!r}") -print(f"returncode: {result.returncode}") - -# 4. cat CHANGELOG.md (full content) -print() -print("=" * 60) -print("4. cat CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["cat", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) -print(f"stdout: {result.stdout!r}") -print(f"stderr: {result.stderr!r}") -print(f"returncode: {result.returncode}") - -# 4b. Read file directly with Python to see what's going on -print() -print("=" * 60) -print("4b. Python open().read() of CHANGELOG.md") -print("=" * 60) -with open(os.path.join(repo_path, "CHANGELOG.md"), "r", errors="replace") as f: - content = f.read() -print(f"Length: {len(content)} characters") -print(f"repr first 500: {content[:500]!r}") -print(f"repr last 200: {content[-200:]!r}") - -# 5. git log --oneline -1 -print() -print("=" * 60) -print("5. git log --oneline -1") -print("=" * 60) -result = subprocess.run( - ["git", "log", "--oneline", "-1"], - capture_output=True, text=True, cwd=repo_path -) -print(f"stdout: {result.stdout!r}") -print(f"stderr: {result.stderr!r}") -print(f"returncode: {result.returncode}") - -# 6. git log --oneline -1 -- CHANGELOG.md -print() -print("=" * 60) -print("6. git log --oneline -1 -- CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["git", "log", "--oneline", "-1", "--", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) - -# Also try git show to see file content at HEAD -print() -print("=" * 60) -print("7. git show HEAD:CHANGELOG.md (first 100 lines)") -print("=" * 60) -result = subprocess.run( - ["git", "show", "HEAD:CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) -if result.stdout: - lines = result.stdout.splitlines() - print(f"Total lines in HEAD version: {len(lines)}") - print(f"First 50 lines:") - for line in lines[:50]: - print(f" {line!r}") - print(f"\nLast 20 lines:") - for line in lines[-20:]: - print(f" {line!r}") -else: - print(f"stdout: {result.stdout!r}") - print(f"stderr: {result.stderr!r}") - print(f"returncode: {result.returncode}") - -# 8. git show the actual commit result -print() -print("=" * 60) -print("8. git log --oneline -1 -- CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["git", "log", "--oneline", "-1", "--", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) - -# Also check git status -print() -print("=" * 60) -print("9. git status CHANGELOG.md") -print("=" * 60) -result = subprocess.run( - ["git", "status", "CHANGELOG.md"], - capture_output=True, text=True, cwd=repo_path -) -print(f"stdout: {result.stdout}") -print(f"stderr: {result.stderr}")