mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
feat: Add plain git log to update-history script context
This commit is contained in:
parent
cd32311c1f
commit
4980e901a0
1 changed files with 24 additions and 0 deletions
|
@ -52,9 +52,26 @@ def run_git_diff():
|
||||||
return result.stdout
|
return result.stdout
|
||||||
|
|
||||||
|
|
||||||
|
def run_plain_git_log():
|
||||||
|
latest_ver = get_latest_version_from_history()
|
||||||
|
cmd = [
|
||||||
|
"git",
|
||||||
|
"log",
|
||||||
|
f"v{latest_ver}..HEAD",
|
||||||
|
"--",
|
||||||
|
"aider/",
|
||||||
|
":!aider/website/",
|
||||||
|
":!scripts/",
|
||||||
|
":!HISTORY.md",
|
||||||
|
]
|
||||||
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
|
return result.stdout
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Get the git log and diff output
|
# Get the git log and diff output
|
||||||
log_content = run_git_log()
|
log_content = run_git_log()
|
||||||
|
plain_log_content = run_plain_git_log()
|
||||||
diff_content = run_git_diff()
|
diff_content = run_git_diff()
|
||||||
|
|
||||||
# Extract relevant portion of HISTORY.md
|
# Extract relevant portion of HISTORY.md
|
||||||
|
@ -91,6 +108,10 @@ def main():
|
||||||
tmp_diff.write(diff_content)
|
tmp_diff.write(diff_content)
|
||||||
diff_path = tmp_diff.name
|
diff_path = tmp_diff.name
|
||||||
|
|
||||||
|
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".plain_log") as tmp_plain_log:
|
||||||
|
tmp_plain_log.write(plain_log_content)
|
||||||
|
plain_log_path = tmp_plain_log.name
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".md") as tmp_hist:
|
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".md") as tmp_hist:
|
||||||
tmp_hist.write(relevant_history)
|
tmp_hist.write(relevant_history)
|
||||||
hist_path = tmp_hist.name
|
hist_path = tmp_hist.name
|
||||||
|
@ -108,6 +129,8 @@ def main():
|
||||||
"--read",
|
"--read",
|
||||||
log_path,
|
log_path,
|
||||||
"--read",
|
"--read",
|
||||||
|
plain_log_path,
|
||||||
|
"--read",
|
||||||
diff_path,
|
diff_path,
|
||||||
"--msg",
|
"--msg",
|
||||||
message,
|
message,
|
||||||
|
@ -141,6 +164,7 @@ def main():
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
os.unlink(log_path)
|
os.unlink(log_path)
|
||||||
|
os.unlink(plain_log_path)
|
||||||
os.unlink(diff_path)
|
os.unlink(diff_path)
|
||||||
os.unlink(hist_path)
|
os.unlink(hist_path)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue